rurban / floppsy

:baby_chick: floppsy - slow hash designed for floating point hardware

Home Page:https://cutt.ly/floppsy-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐤 floppsy npm downloads version

A tiny, simple and slow hash designed for floating point hardware.

demo

play with a demo online here

construction

constructed using floating point multiplication, division and addition.

based on continued and egyptian fractions.

no bit operations used in the making of this hash.

accolades

passes smhasher

see the results for all tests

disclaimer

no claims are made regarding the security of this system.

get

npm i --save floppsy

include

As a Node ES module:

import floppsy from 'floppsy';

As old style modules:

const floppsy = require('floppsy').default;

Using Snowpack in a web app:

import floppsy from './web_modules/floppsy.js';

api

Can produce digests of 32, 64 or 128 bits.

> f.hash('')
'7f5f8491f0b745bf'
> f.hash('', {bits:32})
'7016ca50'
> f.hash('', {bits:128})
'3f7f508e3fe034033ff0e269b0c66356'

Can also change output format:

  x.hash('',{out_format:'hex'}); // default
  x.hash('',{out_format:'binary'}); // binary string
  x.hash('',{out_format:'bytes'}); // Uint8Array
  x.hash('',{out_format:'uint32s'}); // Uint32Array

play with a demo online here

About

:baby_chick: floppsy - slow hash designed for floating point hardware

https://cutt.ly/floppsy-demo

License:MIT License


Languages

Language:JavaScript 67.2%Language:C++ 30.7%Language:C 2.2%