Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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(':'))
}
function createLockId(name: string): number {
return crc32.str(name) * ADVISORY_LOCK_ID_SALT
}
function shingleHashList(str, kshingles=2) {
const list = [];
for (const word of shingles(str, kshingles)) {
list.push(crc32.str(word) & 0xffffffff);
}
return list;
}
_getImportTag ( str: string ): string {
const importId = CRC32.str ( str ).toString ( 34 ).slice ( -4 ),
importTag = `Import-${importId}`;
return importTag;
}
function calculateQueryCRC(query: string): string {
const crcNumber = CRC32.str(query) + Math.pow(16, 8) / 2;
return crcNumber.toString(16).padStart(8, '0');
}
export const encipherImport = (str: string) => {
return crc32.str(str).toString(32);
};
? 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 }) => (
<div>
<div>
</div></div>
var hash = function (string) {
return ('000' + bases.toBase64(Math.abs(crc32.str(string)) % 14776336)).substr(-5).replace('+', '-').replace('/', '_');
};