imkcat / CatCrypto

An easy way for hashing and encryption.
MIT License
69 stars 13 forks source link

How can I get the hash string? #7

Closed qinzhibo closed 4 years ago

qinzhibo commented 5 years ago

I use the CatArgon2Crypto with this code, let argon2Crypto = CatArgon2Crypto() argon2Crypto.context.mode = .argon2id argon2Crypto.context.salt = "5E844EE4D2E26920F8B0C4B784692905" argon2Crypto.context.parallelism = 1 argon2Crypto.context.memory = 14 argon2Crypto.context.iterations = 1 let result = argon2Crypto.hash(password: password) And I get the result string: $argon2id$v=19$m=14,t=1,p=1$NUU4NDRFRTREMkUyNjkyMEY4QjBDNEI3ODQ2OTI5MDU$RJedQCuhWywUpZ9PUnu5+KbzHBQZ5UgvPr6SOYuPTgg\0 How can I get the hash string? Like this: EE0A64A2438896F6B825DD25A655B88EFE05CC5847D1FC0826E9B2E58AA248EB

imkcat commented 4 years ago

@qinzhibo Sorry for the delay response, use result.hexStringValue() to output the hex string.