import { mergeUint8 } from '@pezkuwi/papi-utils';
import { u64 } from 'scale-ts';
import { h64 } from './h64.mjs';

const Twox128 = (input) => {
  const result = new Uint8Array(16);
  const dv = new DataView(result.buffer);
  dv.setBigUint64(0, h64(input), true);
  dv.setBigUint64(8, h64(input, 1n), true);
  return result;
};
const Twox256 = (input) => {
  const result = new Uint8Array(32);
  const dv = new DataView(result.buffer);
  dv.setBigUint64(0, h64(input), true);
  dv.setBigUint64(8, h64(input, 1n), true);
  dv.setBigUint64(16, h64(input, 2n), true);
  dv.setBigUint64(24, h64(input, 3n), true);
  return result;
};
const Twox64Concat = (encoded) => mergeUint8([u64.enc(h64(encoded)), encoded]);

export { Twox128, Twox256, Twox64Concat };
//# sourceMappingURL=twoX.mjs.map
