Libraryless. Click here for Pure Java version (12666L/73K).
srecord noeq HashBinaryImage(IBinaryImage img) { long hash; long get() { if (img == null) ret hash; var img = this.img.toImage2B(); int w = img.getWidth(), h = img.getHeight(); int n = w*h; byte[] pixels = img.pixels; addToHash(w); addToHash(h); for i to n: addToHash((pixels[i/8] & (1 << (i & 7))) != 0 ? 0xFFFFFFFF : 0xFF000000); ret hash; } void addToHash(long x) { hash = boostHashCombine64(hash, x); } }
Began life as a copy of #1034815
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1035835 |
Snippet name: | HashBinaryImage - makes a 64 bit hash of an IBinaryImage (compatible with HashBufferedImage) |
Eternal ID of this version: | #1035835/4 |
Text MD5: | 4ea07c5f99f6dd969950a206a50705db |
Transpilation MD5: | cfeca2e9e3af2d321301373c9fe8d5dd |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-08-02 19:20:22 |
Source code size: | 505 bytes / 24 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 145 / 210 |
Version history: | 3 change(s) |
Referenced in: | #1003674 - Standard Classes + Interfaces (LIVE continued in #1034167) #1037264 - BinaryImageToString |