/**
 * Copyright 2018 Twitter, Inc.
 * Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 */ import stringify = require ( "fast-stable-stringify" ) ; import * as murmurJs from "murmurhash3.js" ; export function murmurhashJsonHexSync ( data ) { const inputBuffer = Buffer . from ( stringify ( data ) , "utf8" ) ; return murmurhashHexSync ( inputBuffer ) ; } export async function murmurhashJsonHex ( data ) { return murmurhashJsonHexSync ( data ) ; } export async function murmurhashJsonBuffer ( data ) { const inputBuffer = Buffer . from ( stringify ( data ) , "utf8" ) ; return murmurhashSync ( inputBuffer ) ; } export async function murmurhashJson ( data ) { return murmurhashJsonBuffer ( data ) ; } export function murmurhashHexSync ( data ) { return murmurhashSync ( data ) . toString ( "hex" ) ; } export function murmurhashSync ( data ) { return Buffer . from ( murmurJs . x64 . hash128 ( data ) ) ; }