We don't yet have submodules in the standard library, but looking at this SHA-256 PR more and more, I'm becoming convinced that as we extend the module further, it would be better to have a Crypt.Sha256
module with empty
, addBytes
, and digest
functions instead of sha256Empty
, sha256AddBytes
, and sha256Digest
. I expect we'll be adding other Crypt
types, like Argon2
or Sha1
or something at some point.
Is anyone opposed to this? Otherwise, I think we can still merge the above PR, and then migrate to the above design once we implement submodules in builtins, which don't exist yet.
I'd like to merge as-is and discuss options
Same
Aside, can we call it crypto instead of the shorter crypt. I think of a stone room below a church everytime someone mentions that. :upside_down:
I'm not seeing a GitHub issue linked or at all that decided on the name. I'm okay with either, but I guess Crypt
less implies Crypto
like the currency
but do you think of Bitcoin when you think of Crypto
? :stuck_out_tongue:
But I don't think that's a strong reason?
it's not like Cryp
or Cry
are good either :laughing:
Cipher
? Math
? Hash
?
Hash should be dedicated to a derive IMO for HashMaps
Hacker
:keyboard: :rabbit:
hm, we already have a Hash
module :thinking:
could it make sense to have all the cryptography stuff in there?
Probably misleading?
I think we're doing that to avoid negative association with cryptocurrency lol
aka I'm voting for Crypto
Hash and CryptoHash. I think they should at least split the namespace somehow. Cause if you don't want someone to accidentally use a regular hash for a cryptographic purpose.
Well, I'd vote Crypto.Hash
Or even just Crypto.Sha256
Unless we change submodule imports to make the unqualified submodule available, import Crypto.Hash.Sha256
would mean you'd need to do Crypto.Hash.Sha256.addBytes [...]
Pretty verbose
Richard Feldman said:
but do you think of Bitcoin when you think of
Crypto
? :stuck_out_tongue:
I definitely don't, but maybe I'm too old. I think of https://en.wikipedia.org/wiki/Cryptography and stories like the code breakers from WWII
CryptoLikeWorldWar2CryptoButModern.Sha256
:stuck_out_tongue:
#notcurrency
I'm 24 and don't think of cryptocurrency at all. But maybe that is because I'm doing a security major at university
In zig, the package is called crypto. In Go, its also called crypto. The Javascript Web API is called crypto. Maybe this is a common term :smile:
@Matthew Heath heads up, this is a discussion pertaining to your module/PR. Any thoughts?
What about Cryptography
? I don’t mind the length
I also don't mind the length, but since we've been pushing for qualified function-aware naming, as we expect people to do Dict.insert
without exposing the insert function, we have been pushing for concise module names
yeah I guess Crypto
is fine
but I'd like to avoid introducing a dot in the name
we don't have that for any builtins and I don't think now is the time to change that
we can always revisit later
Then I can make a second PR later to change the name. This'll be on Sunday, in case we change our mind on the name
interesting note about crypto
in Go: https://news.ycombinator.com/item?id=42965770
apparently "Microsoft Go" is a fork of Go just to make crypto
FIPS 140-2 compliant: (I have no idea what that entails)
This repository produces a modified version of Go that can be used to build FIPS 140-2 compliant applications. Our goal is to share this implementation with others in the Go community who have the same requirement, and to merge this capability into upstream Go as soon as possible.
Last updated: Jul 06 2025 at 12:14 UTC