README: add sha example
This commit is contained in:
parent
d70d902901
commit
4a0b3b9c65
1 changed files with 15 additions and 0 deletions
15
README.md
15
README.md
|
|
@ -1038,6 +1038,21 @@ clojure.core/ffirst
|
||||||
Same as (first (first x))
|
Same as (first (first x))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### SHA hash string and print in hex
|
||||||
|
|
||||||
|
`sha.clj`:
|
||||||
|
```
|
||||||
|
(def hashed (.digest (.getInstance java.security.MessageDigest "SHA-1")
|
||||||
|
(.getBytes "babashka")))
|
||||||
|
(doseq [b hashed]
|
||||||
|
(print (format "%02X" b)))
|
||||||
|
```
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
bb sha.clj
|
||||||
|
0AB318BE3A646EEB1E592781CBFE4AE59701EDDF
|
||||||
|
```
|
||||||
|
|
||||||
## Thanks
|
## Thanks
|
||||||
|
|
||||||
- [adgoji](https://www.adgoji.com/) for financial support
|
- [adgoji](https://www.adgoji.com/) for financial support
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue