MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / wrongCode

Function wrongCode

cmd/pad/cmd_auth_2fa_test.go:483–486  ·  view source on GitHub ↗

wrongCode changes a code's first digit, so it can never be the valid one.

(code string)

Source from the content-addressed store, hash-verified

481
482// wrongCode changes a code's first digit, so it can never be the valid one.
483func wrongCode(code string) string {
484 first := (code[0]-'0'+1)%10 + '0'
485 return string(first) + code[1:]
486}
487
488// Disable's rotation replaces this CLI's session; the saved credential must
489// follow it, and only the token changes.

Callers 1

WriteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected