what i normally do for this is actually a bit more specific, but i don't think it fits as an endpoint option:
digest:=sha256.Sum256([]byte(stringVar))secretBytes:=digest[:]// copy out bytes from strict [32]byte type to []byte used by everything else + irohep,err:=endpoint.New(WithSecretKey(secretBytes))
i wonder, should we create a util package for standalone useful snippets like the above? e.g:
funcSecretBytesFromString(strstring)[]byte{// TODO (2026-11-09): securely clear all arrays to the extent possibledigest:=sha256.Sum256([]byte(str))returndigest[:]// copy out bytes from strict [32]byte type to []byte used by everything else + iroh}
what i normally do for this is actually a bit more specific, but i don't think it fits as an endpoint option:
```golang
digest := sha256.Sum256([]byte(stringVar))
secretBytes := digest[:] // copy out bytes from strict [32]byte type to []byte used by everything else + iroh
ep, err := endpoint.New(WithSecretKey(secretBytes))
```
i wonder, should we create a util package for standalone useful snippets like the above? e.g:
```golang
func SecretBytesFromString(str string) []byte {
// TODO (2026-11-09): securely clear all arrays to the extent possible
digest := sha256.Sum256([]byte(str))
return digest[:] // copy out bytes from strict [32]byte type to []byte used by everything else + iroh
}
Nice, yeh, whatever you want to upstream, go for it ⏫ I generally skirt around a vague utils package and just make tiny specific ones (e.g. a keys/keys.go for a keys.SecretBytesFromString API) but I've not got strong feelings about this!
Nice, yeh, whatever you want to upstream, go for it ⏫ I generally skirt around a vague `utils` package and just make tiny specific ones (e.g. a `keys/keys.go` for a `keys.SecretBytesFromString` API) but I've not got strong feelings about this!
imma go with my approach then since you have no super strong opinion 🐶
haha INTERESTING, i usually love a big chunky util and toss everything in there XD then refactor into e.g. your `keys/keys.go` if need be. case in point https://github.com/cblgh/cerca/blob/main/util/eout/eout.go)
imma go with my approach then since you have no super strong opinion 🐶
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
lil expansion to the options to so that it is easy to use it for adding a static secret key
Haha, very nice! I was just thinking to add this in another changeset 🥇
what i normally do for this is actually a bit more specific, but i don't think it fits as an endpoint option:
i wonder, should we create a util package for standalone useful snippets like the above? e.g:
ping @decentral1se with comment above, you were fast! XD
Nice, yeh, whatever you want to upstream, go for it ⏫ I generally skirt around a vague
utilspackage and just make tiny specific ones (e.g. akeys/keys.gofor akeys.SecretBytesFromStringAPI) but I've not got strong feelings about this!haha INTERESTING, i usually love a big chunky util and toss everything in there XD then refactor into e.g. your
keys/keys.goif need be. case in point https://github.com/cblgh/cerca/blob/main/util/eout/eout.go)imma go with my approach then since you have no super strong opinion 🐶