MCPcopy Create free account

hub / github.com/dchest/captcha / functions

Functions74 in github.com/dchest/captcha

↓ 11 callersFunctionRandomDigits
RandomDigits returns a byte slice of the given length containing pseudorandom numbers in range 0-9. The slice can be used as a captcha solution.
random.go:27
↓ 10 callersMethodGet
Get returns stored digits for the captcha id. Clear indicates whether the captcha must be deleted from the store.
store.go:26
↓ 8 callersMethodSet
Set sets the digits for the captcha id.
store.go:22
↓ 6 callersFunctionrndf
rndf returns a non-crypto pseudorandom float64 in range [from, to].
random.go:78
↓ 5 callersFunctionNewMemoryStore
NewMemoryStore returns a new standard memory store for captchas with the given collection threshold and expiration time (duration). The returned store
store.go:53
↓ 5 callersFunctionrnd
rnd returns a non-crypto pseudorandom int in range [from, to].
random.go:73
↓ 4 callersFunctionNewAudio
NewImage returns a new audio captcha with the given digits, where each digit must be in range 0-9. Digits are pronounced in the given language. If the
audio.go:36
↓ 4 callersMethodWriteTo
BUG(dchest): While Image conforms to io.WriterTo interface, its WriteTo method returns 0 instead of the actual bytes written because png.Encode doesn'
image.go:88
↓ 3 callersFunctionNew
New creates a new captcha with the standard length, saves it in the internal storage and returns its id.
captcha.go:79
↓ 3 callersFunctionNewImage
NewImage returns a new captcha image of the given width and height with the given digits, where each digit must be in range 0-9.
image.go:54
↓ 3 callersFunctionchangeSpeed
changeSpeed returns new PCM bytes from the bytes with the speed and pitch changed to the given value that must be in range [0, x].
audio.go:188
↓ 3 callersMethodcollect
()
store.go:98
↓ 3 callersMethoddrawCircle
(x, y, radius int, colorIdx uint8)
image.go:132
↓ 3 callersFunctionrandomId
randomId returns a new random id string.
random.go:64
↓ 2 callersFunctionReload
Reload generates and remembers new digits for the given captcha id. This function returns false if there is no captcha with the given id. After call
captcha.go:97
↓ 2 callersFunctionVerify
Verify returns true if the given digits are the ones that were used to create the given captcha id. The function deletes the captcha with the given i
captcha.go:134
↓ 2 callersMethodWrite
(b []byte)
image_test.go:13
↓ 2 callersMethodWriteTo
WriteTo writes captcha audio in WAVE format into the given io.Writer, and returns the number of bytes written and an error if any.
audio.go:84
↓ 2 callersFunctionmixSound
mixSound mixes src into dst. Dst must have length equal to or greater than src length.
audio.go:155
↓ 2 callersFunctionrandomBytes
randomBytes returns a byte slice of the given length read from CSPRNG.
random.go:32
↓ 2 callersFunctionrandomBytesMod
randomBytesMod returns a byte slice of the given length, where each byte is a random number modulo mod.
random.go:42
↓ 2 callersFunctionsetSoundLevel
(a []byte, level float64)
audio.go:167
↓ 2 callersFunctionwriteFileRep
(pcm io.Writer, name, prefix string)
capgensounds/main.go:45
↓ 1 callersMethodEncodedLen
EncodedLen returns the length of WAV-encoded audio captcha.
audio.go:121
↓ 1 callersFunctionNewLen
NewLen is just like New, but accepts length of a captcha solution as the argument.
captcha.go:85
↓ 1 callersFunctionWriteImage
WriteImage writes PNG-encoded image representation of the captcha with the given id. The image will have the given width and height.
captcha.go:108
↓ 1 callersMethodcalculateSizes
(width, height, ncount int)
image.go:92
↓ 1 callersMethoddistort
(amplude float64, period float64)
image.go:203
↓ 1 callersMethoddrawDigit
(digit []byte, x, y int)
image.go:186
↓ 1 callersMethoddrawHorizLine
(fromX, toX, y int, colorIdx uint8)
image.go:126
↓ 1 callersMethodfillWithCircles
(n, maxradius int)
image.go:159
↓ 1 callersMethodlongestDigitSndLen
()
audio.go:143
↓ 1 callersMethodmakeBackgroundSound
(length int)
audio.go:125
↓ 1 callersFunctionmakeSilence
(length int)
audio.go:205
↓ 1 callersFunctionmakeWhiteNoise
(length int, level uint8)
audio.go:213
↓ 1 callersFunctionmax3
(x, y, z uint8)
image.go:247
↓ 1 callersFunctionmin3
(x, y, z uint8)
image.go:236
↓ 1 callersFunctionrandomBrightness
(c color.RGBA, max uint8)
image.go:221
↓ 1 callersFunctionrandomPalette
()
image.go:33
↓ 1 callersFunctionrandomSpeed
(a []byte)
audio.go:200
↓ 1 callersMethodrandomizedDigitSound
(n byte)
audio.go:137
↓ 1 callersFunctionreversedSound
(a []byte)
audio.go:224
↓ 1 callersMethodserve
(w http.ResponseWriter, id, ext string, lang string, download bool)
server.go:45
↓ 1 callersMethodstrikeThrough
()
image.go:169
↓ 1 callersFunctionusage
()
capgen/main.go:26
↓ 1 callersFunctionwriteDigitSounds
(pcm io.Writer, lang string)
capgensounds/main.go:59
↓ 1 callersFunctionwriteSingle
(pcm io.Writer, name string)
capgensounds/main.go:53
↓ 1 callersFunctionwriteVar
(w io.Writer, b []byte, prefix string)
capgensounds/main.go:23
FunctionBenchmarkAudioWriteTo
(b *testing.B)
audio_test.go:21
FunctionBenchmarkImageWriteTo
(b *testing.B)
image_test.go:27
FunctionBenchmarkNewAudio
(b *testing.B)
audio_test.go:12
FunctionBenchmarkNewImage
(b *testing.B)
image_test.go:18
FunctionBenchmarkSetCollect
(b *testing.B)
store_test.go:65
MethodGet
(id string, clear bool)
store.go:75
MethodServeHTTP
(w http.ResponseWriter, r *http.Request)
server.go:74
FunctionServer
Server returns a handler that serves HTTP requests with image or audio representations of captchas. Image dimensions are accepted as arguments. The se
server.go:41
MethodSet
(id string, digits []byte)
store.go:62
FunctionSetCustomStore
SetCustomStore sets custom storage for captchas, replacing the default memory store. This function must be called before generating any captchas.
captcha.go:73
FunctionTestCollect
(t *testing.T)
store_test.go:38
FunctionTestGetClear
(t *testing.T)
store_test.go:23
FunctionTestNew
(t *testing.T)
captcha_test.go:12
FunctionTestRandomDigits
(t *testing.T)
captcha_test.go:41
FunctionTestReload
(t *testing.T)
captcha_test.go:31
FunctionTestSetGet
(t *testing.T)
store_test.go:12
FunctionTestVerify
(t *testing.T)
captcha_test.go:19
FunctionVerifyString
VerifyString is like Verify, but accepts a string of digits. It removes spaces and commas from the string, but any other characters, apart from digit
captcha.go:148
FunctionWriteAudio
WriteAudio writes WAV-encoded audio representation of the captcha with the given id and the given language. If there are no sounds for the given langu
captcha.go:120
Functioninit
()
random.go:20
Functioninit
()
audio.go:22
Functionmain
()
capexample/main.go:44
Functionmain
()
capgensounds/main.go:69
Functionmain
()
capgen/main.go:31
FunctionprocessFormHandler
(w http.ResponseWriter, r *http.Request)
capexample/main.go:34
FunctionshowFormHandler
(w http.ResponseWriter, r *http.Request)
capexample/main.go:19