3.2.2 ā€¢ Published 9 months ago

hasch v3.2.2

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Install

npm i hasch

Usage

import hasch from 'hasch'

  hasch(new Uint8Array(123))             === 328550458801291844070341966987876531409n
  hasch('abc')                           === 30216508460253319331260144576202890925n
  hasch(123)                             === 235074070585844934564733336785530021059n
  hasch(Buffer.alloc(5))                 === 82223369041381735457708905440885830446n

  hasch('abc', { seed: 123 })            === 266221380790302914276811936392392262090n
  hasch('abc', { seed: 246 })            === 268273496397672601563576200830246633940n

  hasch('abc', { base: 8 })              === "265667634335613025344536104026336337257255"
  hasch('abc', { base: 12 })             === "617b98437b43184529042060a7607120125"
  hasch('abc', { base: 36 })             === "1cg66nyuy96rto54mr28cm84t"
  hasch('abc', { base: 36, seed: 1000 }) === "7v1fb64sz40yaulnbbn5uogpr"

  hasch('abc', { base: 36, length: 6 })  === "1cg66n"
  hasch('abc', { base: 36, length: 20 }) === "1cg66nyuy96rto54mr28"
  hasch('abc', { base: 36, length: 30 }) === "000001cg66nyuy96rto54mr28cm84t"

  hasch('abc', { decimal: true })        === 0.0144576202890925
  hasch('abc', { choose: [2, 4, 'a'] })  === 2

Author

šŸ‘¤ Konrad Pettersson

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to create an issue on GitHub.

This README was generated with ā¤ļø by readme-md-generator

3.2.2

9 months ago

3.2.0

12 months ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago