Comments (4)
hex_md5("你好") is "7eca689f0d3389d9dea66ae112e5cfd7". But
(pandect.algo.md5/md5 "你好") is "b94ae3c6d892b29cf48d9bea819b27b9"
from pandect.
Your default charset does not seem to be UTF-8. For me, it's working:
(require '[pandect.algo [sha1 :refer [sha1]] [md5 :refer [md5]]])
(let [data "你好"]
[(sha1 data) (md5 data)])
;; => ["440ee0853ad1e99f962b63e459ef992d7c211722"
;; "7eca689f0d3389d9dea66ae112e5cfd7"]
The following should give you the right result:
(sha1 (.getBytes "你好" "UTF-8"))
But yes, pandect should by default convert to UTF-8 bytes.
from pandect.
Changes were released in
[pandect "0.5.0"]
from pandect.
from pandect.
Related Issues (13)
- get string from hmac HOT 2
- 'SipHash-2-4' not available when AOT-compiled
- IllegalArgumentException No implementation of method: :compute-md51218 of protocol: HOT 1
- Unexpected side-effect of sha on stream HOT 2
- java.lang.SecurityException HOT 4
- Regression: Improper namespacing of inline deps causes collisions HOT 6
- Add Support for SipHash HOT 2
- Add Support for BLAKE2 HOT 3
- Security Exception HOT 6
- Doesn't work when uberjar'ed HOT 3
- AOT issue with 0.4.0? HOT 6
- Slow startup HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandect.