How to use the crc-32.str function in crc-32

To help you get started, we’ve selected a few crc-32 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bitfinexcom / bitfinex-api-node / lib / models / order_book.js View on Github external
if (ask) {
        const price = raw ? ask[0] : Number(preparePrice(ask[0]))

        data.push(
          raw
            ? ask[0]
            : /e/.test(price + '')
              ? price.toFixed(Math.abs((price + '').split('e')[1]) + 1) // i.e. 1.7e-7 to fixed
              : price,
          ask[2]
        )
      }
    }

    return CRC.str(data.join(':'))
  }
github sourcegraph / sourcegraph / lsif / src / shared / store / locks.ts View on Github external
function createLockId(name: string): number {
    return crc32.str(name) * ADVISORY_LOCK_ID_SALT
}
github telegram-ru / jobs-bot / deduplicator / minhash.js View on Github external
function shingleHashList(str, kshingles=2) {
  const list = [];
  for (const word of shingles(str, kshingles)) {
    list.push(crc32.str(word) & 0xffffffff);
  }
  return list;
}
github notable / notable / src / renderer / containers / main / import.ts View on Github external
_getImportTag ( str: string ): string {

    const importId = CRC32.str ( str ).toString ( 34 ).slice ( -4 ),
          importTag = `Import-${importId}`;

    return importTag;

  }
github Lumeer / web-ui / src / app / core / store / navigation / query-param-encoding.ts View on Github external
function calculateQueryCRC(query: string): string {
  const crcNumber = CRC32.str(query) + Math.pow(16, 8) / 2;
  return crcNumber.toString(16).padStart(8, '0');
}
github theKashey / react-imported-component / src / babel.ts View on Github external
export const encipherImport = (str: string) => {
  return crc32.str(str).toString(32);
};
github mirumee / saleor / saleor / static / dashboard-next / vouchers / components / VoucherDetailsPage / VoucherDetailsPage.tsx View on Github external
? voucher.discountValueType
                  : "",
              endDate: voucher && voucher.endDate ? voucher.endDate : null,
              limit: voucher && voucher.limit ? voucher.limit.amount : null,
              name: voucher && voucher.name ? voucher.name : "",
              product:
                voucher && voucher.product
                  ? { label: voucher.product.name, value: voucher.product.id }
                  : null,
              startDate:
                voucher && voucher.startDate ? voucher.startDate : null,
              type: voucher && voucher.type ? voucher.type : "VALUE",
              usageLimit:
                voucher && voucher.usageLimit ? voucher.usageLimit : null
            }}
            key={voucher ? CRC.str(JSON.stringify(voucher)) : "loading"}
          >
            {({ change, data, hasChanged, submit }) => (
              <Container width="md">
                <PageHeader
                  title={
                    voucher
                      ? voucher.name !== null
                        ? voucher.name
                        : createVoucherName(voucher, currency)
                      : undefined
                  }
                  onBack={onBack}
                />
                <div className={classes.root}>
                  <div>
                    <VoucherDetails
github Fusl / intrace / lg.js View on Github external
var hash = function (string) {
	return ('000' + bases.toBase64(Math.abs(crc32.str(string)) % 14776336)).substr(-5).replace('+', '-').replace('/', '_');
};

crc-32

Pure-JS CRC-32

Apache-2.0
Latest version published 10 months ago

Package Health Score

74 / 100
Full package analysis

Popular crc-32 functions