(function (_, XXH, kotlin_kotlin, kotlin_io_ktor_ktor_io) {
  'use strict';
  //region block: imports
  var protoOf = kotlin_kotlin.$_$.dg;
  var interfaceMeta = kotlin_kotlin.$_$.ef;
  var setMetadataFor = kotlin_kotlin.$_$.eg;
  var classMeta = kotlin_kotlin.$_$.oe;
  var VOID = kotlin_kotlin.$_$.g;
  var toULong = kotlin_kotlin.$_$.jl;
  var _ULong___get_data__impl__fggpzb = kotlin_kotlin.$_$.v4;
  var Charsets_getInstance = kotlin_io_ktor_ktor_io.$_$.g;
  var encodeToByteArray = kotlin_kotlin.$_$.ti;
  var encodeToByteArray_0 = kotlin_io_ktor_ktor_io.$_$.k;
  //endregion
  //region block: pre-declaration
  setMetadataFor(XXHasher64, 'XXHasher64', interfaceMeta);
  setMetadataFor(XXHasher64Factory, 'XXHasher64Factory', interfaceMeta);
  setMetadataFor(XXStringHasher, 'XXStringHasher', interfaceMeta);
  setMetadataFor(XXHasher64FactoryJs, 'XXHasher64FactoryJs', classMeta, VOID, [XXHasher64Factory], XXHasher64FactoryJs);
  setMetadataFor(XXHasher64Js, 'XXHasher64Js', classMeta, VOID, [XXHasher64]);
  setMetadataFor(XXStringHasherJs, 'XXStringHasherJs', classMeta, VOID, [XXStringHasher], XXStringHasherJs);
  //endregion
  function XXHasher64() {
  }
  function XXHasher64Factory() {
  }
  function XXStringHasher() {
  }
  function XXHasher64FactoryJs() {
  }
  protoOf(XXHasher64FactoryJs).newHasher_bylh2l_k$ = function (seed) {
    var hasher = XXH.h64();
    hasher.init(seed);
    return new XXHasher64Js(hasher);
  };
  function _get_hasher64__tptygi($this) {
    return $this.hasher64__1;
  }
  function XXHasher64Js(hasher64) {
    this.hasher64__1 = hasher64;
  }
  protoOf(XXHasher64Js).update_abaron_k$ = function (data) {
    // Inline function 'js.typedarrays.toUint8Array' call
    // Inline function 'js.typedarrays.asInt8Array' call
    // Inline function 'kotlin.js.unsafeCast' call
    // Inline function 'kotlin.js.asDynamic' call
    var array = data;
    var array_0 = new Uint8Array(array.buffer, array.byteOffset, array.length);
    this.hasher64__1.update(array_0.buffer);
  };
  protoOf(XXHasher64Js).digest_m0ziv0_k$ = function () {
    var digestStr = this.hasher64__1.digest().toString(10);
    // Inline function 'kotlin.ULong.toLong' call
    var this_0 = toULong(digestStr);
    return _ULong___get_data__impl__fggpzb(this_0);
  };
  function XXStringHasherJs() {
  }
  protoOf(XXStringHasherJs).hash_6htf84_k$ = function (string) {
    // Inline function 'js.typedarrays.toUint8Array' call
    var tmp$ret$0;
    $l$block: {
      // Inline function 'io.ktor.utils.io.core.toByteArray' call
      var charset = Charsets_getInstance().get_UTF_8_ihn39z_k$();
      if (charset.equals(Charsets_getInstance().get_UTF_8_ihn39z_k$())) {
        tmp$ret$0 = encodeToByteArray(string);
        break $l$block;
      }
      tmp$ret$0 = encodeToByteArray_0(charset.newEncoder_gqwcdg_k$(), string, 0, string.length);
    }
    // Inline function 'js.typedarrays.asInt8Array' call
    // Inline function 'kotlin.js.unsafeCast' call
    // Inline function 'kotlin.js.asDynamic' call
    var array = tmp$ret$0;
    var array_0 = new Uint8Array(array.buffer, array.byteOffset, array.length);
    var hash = XXH.h64(array_0.buffer, 0).toString(10);
    // Inline function 'kotlin.ULong.toLong' call
    var this_0 = toULong(hash);
    return _ULong___get_data__impl__fggpzb(this_0);
  };
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = XXHasher64FactoryJs;
  _.$_$.b = XXStringHasherJs;
  _.$_$.c = XXHasher64Factory;
  _.$_$.d = XXStringHasher;
  //endregion
  return _;
}(module.exports, require('xxhashjs'), require('./kotlin-kotlin-stdlib.js'), require('./ktor-ktor-io.js')));

//# sourceMappingURL=UstadMobile-lib-xxhashkmp-core.js.map
