urbit-ob

JavaScript utilities for phonemic base wrangling.
git clone git://git.jtobin.io/urbit-ob.git
Log | Files | Refs | README

muk.test.js (586B)


      1 const BN = require('bn.js')
      2 const { expect } = require('chai');
      3 const isEqual = require('lodash.isequal')
      4 const { muk } = require('../src/internal/muk')
      5 
      6 describe('muk', () => {
      7   it('matches expected reference values', () => {
      8     let input = new BN(0x101)
      9     let output = new BN(0x42081a9b)
     10     expect(muk(0, 2, input).eq(output)).to.equal(true)
     11 
     12     input = new BN(0x201)
     13     output = new BN(0x64c7667e)
     14     expect(muk(0, 2, input).eq(output)).to.equal(true)
     15 
     16     input = new BN(0x4812)
     17     output = new BN(0xa30782dc)
     18     expect(muk(0, 2, input).eq(output)).to.equal(true)
     19   })
     20 })