GetHashVersion takes ciphertext string and returns goSecretBoxPassword version as int and error.
(ciphertext string)
| 82 | |
| 83 | // GetHashVersion takes ciphertext string and returns goSecretBoxPassword version as int and error. |
| 84 | func 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. |
| 95 | func GetParams(ciphertext string) (userParams, masterParams ScryptParams, err error) { |
no outgoing calls