MCPcopy Index your code

hub / github.com/dchest/captcha / functions

Functions91 in github.com/dchest/captcha

↓ 13 callersMethodInt
Int returns a pseudorandom int in range [from, to].
siprng.go:271
↓ 13 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:59
↓ 13 callersMethodSet
Set sets the digits for the captcha id.
store.go:22
↓ 13 callersMethodWrite
(b []byte)
image_test.go:13
↓ 11 callersMethodGet
Get returns stored digits for the captcha id. Clear indicates whether the captcha must be deleted from the store.
store.go:26
↓ 9 callersMethodFloat
Float returns a pseudorandom float64 in range [from, to].
siprng.go:276
↓ 7 callersMethodIntn
(n int)
siprng.go:234
↓ 7 callersMethodUint64
Uint64 returns a new pseudorandom uint64.
siprng.go:200
↓ 7 callersFunctionrandomId
randomId returns a new random id string.
random.go:102
↓ 6 callersMethodBytes
(n int)
siprng.go:206
↓ 5 callersFunctionNew
New creates a new captcha with the standard length, saves it in the internal storage and returns its id.
captcha.go:79
↓ 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 callersMethodSeed
Seed sets a new secret seed for PRNG.
siprng.go:193
↓ 5 callersMethoddrawHorizLine
(fromX, toX, y int, colorIdx uint8)
image.go:141
↓ 4 callersFunctionNewAudio
NewAudio 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:33
↓ 4 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:36
↓ 4 callersMethodWriteTo
WriteTo writes captcha image in PNG format into the given writer.
image.go:99
↓ 3 callersMethodInt63
()
siprng.go:222
↓ 3 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
↓ 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:205
↓ 3 callersMethodcollect
()
store.go:98
↓ 3 callersMethoddrawCircle
(x, y, radius int, colorIdx uint8)
image.go:147
↓ 2 callersMethodInt31
()
siprng.go:230
↓ 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 callersFunctionderiveSeed
deriveSeed returns a 16-byte PRNG seed from rngKey, purpose, id and digits. Same purpose, id and digits will result in the same derived seed for this
random.go:44
↓ 2 callersFunctionmixSound
mixSound mixes src into dst. Dst must have length equal to or greater than src length.
audio.go:172
↓ 2 callersFunctionrandomBytesMod
randomBytesMod returns a byte slice of the given length, where each byte is a random number modulo mod.
random.go:74
↓ 2 callersFunctionsetSoundLevel
(a []byte, level float64)
audio.go:184
↓ 2 callersFunctionsiphash
siphash implements SipHash-2-4, accepting a uint64 as a message.
siprng.go:16
↓ 2 callersFunctionwriteFileRep
(pcm io.Writer, name, prefix string)
capgensounds/main.go:45
↓ 1 callersMethodFloat64
()
siprng.go:268
↓ 1 callersMethodInt31n
(n int32)
siprng.go:256
↓ 1 callersMethodInt63n
(n int64)
siprng.go:244
↓ 1 callersFunctionNewLen
NewLen is just like New, but accepts length of a captcha solution as the argument.
captcha.go:85
↓ 1 callersFunctionServer
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:42
↓ 1 callersMethodUint32
()
siprng.go:226
↓ 1 callersFunctionVerifyString
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
↓ 1 callersFunctionWriteAudio
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
↓ 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 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:85
↓ 1 callersMethodcalculateSizes
(width, height, ncount int)
image.go:104
↓ 1 callersMethoddistort
(amplude float64, period float64)
image.go:218
↓ 1 callersMethoddrawDigit
(digit []byte, x, y int)
image.go:201
↓ 1 callersMethodencodedPNG
encodedPNG encodes an image to PNG and returns the result as a byte slice.
image.go:90
↓ 1 callersMethodfillWithCircles
(n, maxradius int)
image.go:174
↓ 1 callersMethodgetRandomPalette
()
image.go:69
↓ 1 callersMethodlongestDigitSndLen
()
audio.go:144
↓ 1 callersMethodmakeBackgroundSound
(length int)
audio.go:126
↓ 1 callersFunctionmakeSilence
(length int)
audio.go:217
↓ 1 callersMethodmakeWhiteNoise
(length int, level uint8)
audio.go:159
↓ 1 callersFunctionmax3
(x, y, z uint8)
image.go:262
↓ 1 callersFunctionmin3
(x, y, z uint8)
image.go:251
↓ 1 callersMethodrandomBrightness
(c color.RGBA, max uint8)
image.go:236
↓ 1 callersFunctionrandomBytes
randomBytes returns a byte slice of the given length read from CSPRNG.
random.go:64
↓ 1 callersMethodrandomSpeed
(b []byte)
audio.go:154
↓ 1 callersMethodrandomizedDigitSound
(n byte)
audio.go:138
↓ 1 callersFunctionreversedSound
(a []byte)
audio.go:225
↓ 1 callersMethodserve
(w http.ResponseWriter, r *http.Request, id, ext, lang string, download bool)
server.go:46
↓ 1 callersMethodstrikeThrough
()
image.go:184
↓ 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:22
FunctionBenchmarkImageWriteTo
(b *testing.B)
image_test.go:28
FunctionBenchmarkNewAudio
(b *testing.B)
audio_test.go:12
FunctionBenchmarkNewImage
(b *testing.B)
image_test.go:18
FunctionBenchmarkSetCollect
(b *testing.B)
store_test.go:64
FunctionBenchmarkSiprng
(b *testing.B)
siprng_test.go:48
MethodEncodedLen
EncodedLen returns the length of WAV-encoded audio captcha.
audio.go:122
MethodGet
(id string, clear bool)
store.go:75
MethodServeHTTP
(w http.ResponseWriter, r *http.Request)
server.go:70
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
FunctionTestSiphash
(t *testing.T)
siprng_test.go:8
FunctionTestSiprng
(t *testing.T)
siprng_test.go:16
FunctionTestSiprngBytes
(t *testing.T)
siprng_test.go:30
FunctionTestVerify
(t *testing.T)
captcha_test.go:19
Functioninit
()
random.go:25
Functioninit
()
audio.go:18
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