MCPcopy Create free account
hub / github.com/dwin/goSecretBoxPassword / GetHashVersion

Function GetHashVersion

password.go:84–92  ·  view source on GitHub ↗

GetHashVersion takes ciphertext string and returns goSecretBoxPassword version as int and error.

(ciphertext string)

Source from the content-addressed store, hash-verified

82
83// GetHashVersion takes ciphertext string and returns goSecretBoxPassword version as int and error.
84func GetHashVersion(ciphertext string) (version int, err error) {
85 parts := strings.Split(ciphertext, "$")
86 s := strings.Trim(parts[0], "secBoxv")
87 version, err = strconv.Atoi(s)
88 if err != nil {
89 return
90 }
91 return
92}
93
94// GetParams takes ciphertext string, returns user and master parameters and error. This may be useful for upgrading.
95func GetParams(ciphertext string) (userParams, masterParams ScryptParams, err error) {

Callers 1

TestGetHashVersionFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetHashVersionFunction · 0.68