@utilix-tech/sdk 0.39.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Full release notes for all Utilix surfaces (browser tools, REST API, SDKs, MCP server) live at [utilix.tech/changelog](https://utilix.tech/changelog). This file tracks just this package.
4
4
 
5
+ ## 0.40.0
6
+ - Add `calculateCashBreakdown`, `calculateChange` (cash-till-calculator): break a cash amount down into the minimum count of bills/coins from a set of denominations (largest first), or compute change owed for a payment/tender pair and its breakdown.
7
+ - Add `generateEtag` (etag-generator): compute a content-hash ETag (MD5/SHA-1/SHA-256) for a response header, with an optional weak-validator (W/) prefix.
8
+
5
9
  ## 0.39.0
6
10
  - Add `generateSri`, `generateSriAll` (sri-hash-generator): compute SHA-256/384/512 Subresource Integrity hashes for a script or stylesheet's content, formatted as the `<algorithm>-<base64>` string an HTML `integrity` attribute expects.
7
11
  - Add `analyzeEmailHeaders` (email-header-analyzer): parse a raw email header block into structured From/To/Subject fields, the Received hop chain in order, and SPF/DKIM/DMARC results from an Authentication-Results header.
package/README.md CHANGED
@@ -135,6 +135,10 @@ generateHtpasswdFile([{ username: "alice", password: "secret" }]);
135
135
  // Subresource Integrity hashes for a script/stylesheet's content (SHA-256/384/512)
136
136
  generateSriAll("console.log(1)");
137
137
  // [{ algorithm: "SHA-256", base64: "...", integrity: "sha256-..." }, ...]
138
+
139
+ // Content-hash ETag header value (MD5/SHA-1/SHA-256), with an optional weak (W/) prefix
140
+ generateEtag("console.log(1)");
141
+ // { algorithm: "SHA-1", weak: false, hash: "...", etag: "\"...\"", snippet: "ETag: \"...\"" }
138
142
  ```
139
143
 
140
144
  ---
@@ -406,6 +410,14 @@ calculateRoi({ initialValue: 1000, finalValue: 1610.51, years: 5 });
406
410
  // Unit price comparator: true cost per unit across package options, flags the cheapest
407
411
  compareUnitPrices([{ label: "12-pack", price: 6, quantity: 12 }, { label: "24-pack", price: 10, quantity: 24 }]);
408
412
  // { items: [...], bestLabel: "24-pack" }
413
+
414
+ // Cash till breakdown: minimum count of bills/coins from a set of denominations
415
+ calculateCashBreakdown(53.75, USD_DENOMINATIONS);
416
+ // { breakdown: [{ denomination: 50, count: 1, subtotal: 50 }, ...], totalCount: 7, remainder: 0 }
417
+
418
+ // Change owed for a payment/tender pair, broken down the same way
419
+ calculateChange(4.65, 5.0, USD_DENOMINATIONS);
420
+ // { changeDue: 0.35, breakdown: [{ denomination: 0.25, count: 1, subtotal: 0.25 }, ...], totalCount: 2 }
409
421
  ```
410
422
 
411
423
  ---
@@ -703,12 +715,12 @@ readVideoInfo(new Uint8Array(videoBytes));
703
715
  |---|---|
704
716
  | `@utilix-tech/sdk/json` | Format, minify, diff, validate, JSONPath, CSV↔JSON, YAML↔JSON, TS types from data or from a JSON Schema |
705
717
  | `@utilix-tech/sdk/encoding` | Base64, URL, HTML entities, Base32/Base58/Base62 encode/decode |
706
- | `@utilix-tech/sdk/hashing` | MD5, SHA-1/256/512, bcrypt, HMAC, .htpasswd |
718
+ | `@utilix-tech/sdk/hashing` | MD5, SHA-1/256/512, bcrypt, HMAC, .htpasswd, SRI hashes, content-hash ETag generation |
707
719
  | `@utilix-tech/sdk/text` | Case convert, slugify, word count, lorem ipsum, line ops, HTML→Markdown, Levenshtein/Damerau string distance, readability scoring, sentence length distribution, emoji lookup |
708
720
  | `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert, SRT/WebVTT subtitles, Markdown front matter parser |
709
721
  | `@utilix-tech/sdk/generators` | UUID v4/v7, ULID, passwords, strength check, entropy estimator, fake data |
710
722
  | `@utilix-tech/sdk/time` | Date diff, timezone convert, cron parse, relative time |
711
- | `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, EMI calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator, Rule of 72 calculator, savings goal calculator, ROI calculator |
723
+ | `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, EMI calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator, Rule of 72 calculator, savings goal calculator, ROI calculator, cash denomination/till calculator |
712
724
  | `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing, User-Agent parsing, IPv6 address compress/expand |
713
725
  | `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header |
714
726
  | `@utilix-tech/sdk/code` | SQL format/minify, HTML format/minify, regex tester, GraphQL format, MIME type lookup, GitHub URL parsing, regex ReDoS detector, Conventional Commits linter |
@@ -14,12 +14,15 @@ __export(units_exports, {
14
14
  COMMON_TAX_RATES: () => COMMON_TAX_RATES,
15
15
  COMMON_TIP_PERCENTAGES: () => COMMON_TIP_PERCENTAGES,
16
16
  COMMON_VIEWPORTS: () => COMMON_VIEWPORTS,
17
+ USD_DENOMINATIONS: () => USD_DENOMINATIONS,
17
18
  applySuccessiveDiscounts: () => applySuccessiveDiscounts,
18
19
  autoFormat: () => autoFormat,
19
20
  bumpVersion: () => bumpVersion,
20
21
  calcAspectRatio: () => calcAspectRatio,
21
22
  calcSubnet: () => calcSubnet,
22
23
  calculateBreakEven: () => calculateBreakEven,
24
+ calculateCashBreakdown: () => calculateCashBreakdown,
25
+ calculateChange: () => calculateChange,
23
26
  calculateCompoundInterest: () => calculateCompoundInterest,
24
27
  calculateDiscount: () => calculateDiscount,
25
28
  calculateEmi: () => calculateEmi,
@@ -1867,5 +1870,63 @@ function compareUnitPrices(items) {
1867
1870
  const bestLabel = results.find((r) => r.isBest).label;
1868
1871
  return { items: results, bestLabel };
1869
1872
  }
1873
+ var USD_DENOMINATIONS = [100, 50, 20, 10, 5, 1, 0.25, 0.1, 0.05, 0.01];
1874
+ function _cashToCents(n) {
1875
+ return Math.round(n * 100);
1876
+ }
1877
+ function calculateCashBreakdown(amount, denominations) {
1878
+ if (!Number.isFinite(amount) || amount < 0) return { error: "Amount must be zero or a positive number" };
1879
+ if (!Array.isArray(denominations) || denominations.length === 0) {
1880
+ return { error: "At least one denomination is required" };
1881
+ }
1882
+ for (const d of denominations) {
1883
+ if (typeof d !== "number" || !Number.isFinite(d) || d <= 0) {
1884
+ return { error: "Each denomination must be a positive number" };
1885
+ }
1886
+ }
1887
+ const round22 = (n) => Math.round(n * 100) / 100;
1888
+ const sorted = Array.from(new Set(denominations)).sort((a, b) => b - a);
1889
+ let remainingCents = _cashToCents(amount);
1890
+ const breakdown = [];
1891
+ let totalCount = 0;
1892
+ for (const d of sorted) {
1893
+ const dCents = _cashToCents(d);
1894
+ const count = Math.floor(remainingCents / dCents);
1895
+ if (count > 0) {
1896
+ breakdown.push({ denomination: d, count, subtotal: round22(count * d) });
1897
+ remainingCents -= count * dCents;
1898
+ totalCount += count;
1899
+ }
1900
+ }
1901
+ return {
1902
+ amount: round22(amount),
1903
+ denominations: sorted,
1904
+ breakdown,
1905
+ totalCount,
1906
+ remainder: round22(remainingCents / 100)
1907
+ };
1908
+ }
1909
+ function calculateChange(amountDue, amountTendered, denominations) {
1910
+ if (!Number.isFinite(amountDue) || amountDue < 0) return { error: "Amount due must be zero or a positive number" };
1911
+ if (!Number.isFinite(amountTendered) || amountTendered < 0) {
1912
+ return { error: "Amount tendered must be zero or a positive number" };
1913
+ }
1914
+ if (_cashToCents(amountTendered) < _cashToCents(amountDue)) {
1915
+ return { error: "Amount tendered must be greater than or equal to the amount due" };
1916
+ }
1917
+ const round22 = (n) => Math.round(n * 100) / 100;
1918
+ const changeDue = round22(amountTendered - amountDue);
1919
+ const breakdown = calculateCashBreakdown(changeDue, denominations);
1920
+ if ("error" in breakdown) return breakdown;
1921
+ return {
1922
+ amountDue: round22(amountDue),
1923
+ amountTendered: round22(amountTendered),
1924
+ changeDue,
1925
+ denominations: breakdown.denominations,
1926
+ breakdown: breakdown.breakdown,
1927
+ totalCount: breakdown.totalCount,
1928
+ remainder: breakdown.remainder
1929
+ };
1930
+ }
1870
1931
 
1871
- export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCompoundInterest, calculateDiscount, calculateEmi, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
1932
+ export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCashBreakdown, calculateChange, calculateCompoundInterest, calculateDiscount, calculateEmi, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
@@ -6,12 +6,14 @@ import bcrypt from 'bcryptjs';
6
6
  // src/tools/hashing.ts
7
7
  var hashing_exports = {};
8
8
  __export(hashing_exports, {
9
+ ETAG_ALGORITHMS: () => ETAG_ALGORITHMS,
9
10
  HASH_ALGORITHMS: () => HASH_ALGORITHMS,
10
11
  HASH_BITS: () => HASH_BITS,
11
12
  ROUND_OPTIONS: () => ROUND_OPTIONS,
12
13
  SRI_ALGORITHMS: () => SRI_ALGORITHMS,
13
14
  createEntry: () => createEntry,
14
15
  generateBcryptHash: () => generateBcryptHash,
16
+ generateEtag: () => generateEtag,
15
17
  generateHtpasswdFile: () => generateHtpasswdFile,
16
18
  generateMd5Hash: () => generateMd5Hash,
17
19
  generatePlain: () => generatePlain,
@@ -272,5 +274,23 @@ function generateSriAll(content) {
272
274
  }
273
275
  return SRI_ALGORITHMS.map((alg) => generateSri(content, alg));
274
276
  }
277
+ var ETAG_ALGORITHMS = ["MD5", "SHA-1", "SHA-256"];
278
+ var ETAG_NODE_ALG_MAP = {
279
+ "MD5": "md5",
280
+ "SHA-1": "sha1",
281
+ "SHA-256": "sha256"
282
+ };
283
+ function generateEtag(content, algorithm = "SHA-1", weak = false) {
284
+ if (typeof content !== "string" || content.length === 0) {
285
+ return { error: "Content is required" };
286
+ }
287
+ if (!ETAG_ALGORITHMS.includes(algorithm)) {
288
+ return { error: `Unknown algorithm: ${algorithm}. Must be one of ${ETAG_ALGORITHMS.join(", ")}` };
289
+ }
290
+ const hash = createHash(ETAG_NODE_ALG_MAP[algorithm]).update(content, "utf8").digest("hex");
291
+ const quoted = `"${hash}"`;
292
+ const etag = weak ? `W/${quoted}` : quoted;
293
+ return { algorithm, weak, hash, etag, headerName: "ETag", snippet: `ETag: ${etag}` };
294
+ }
275
295
 
276
- export { HASH_ALGORITHMS, HASH_BITS, ROUND_OPTIONS, SRI_ALGORITHMS, createEntry, generateBcryptHash, generateHtpasswdFile, generateMd5Hash, generatePlain, generateSha1Hash, generateSri, generateSriAll, hashAll, hashOne, hashPassword, hashWithTiming, hashing_exports, parseHtpasswdFile, validateRounds, validateUsername, verifyPassword };
296
+ export { ETAG_ALGORITHMS, HASH_ALGORITHMS, HASH_BITS, ROUND_OPTIONS, SRI_ALGORITHMS, createEntry, generateBcryptHash, generateEtag, generateHtpasswdFile, generateMd5Hash, generatePlain, generateSha1Hash, generateSri, generateSriAll, hashAll, hashOne, hashPassword, hashWithTiming, hashing_exports, parseHtpasswdFile, validateRounds, validateUsername, verifyPassword };
@@ -8,6 +8,7 @@
8
8
  * generatePlain, createEntry, parseHtpasswdFile,
9
9
  * generateHtpasswdFile, validateUsername
10
10
  * - sri-hash-generator: generateSri, generateSriAll (SHA-256/384/512 Subresource Integrity hashes)
11
+ * - etag-generator : generateEtag (MD5/SHA-1/SHA-256 content-hash ETag header values)
11
12
  */
12
13
  type HashAlgorithm = 'MD5' | 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
13
14
  declare const HASH_ALGORITHMS: HashAlgorithm[];
@@ -66,8 +67,32 @@ declare function generateSri(content: string, algorithm?: SriAlgorithm): SriResu
66
67
  declare function generateSriAll(content: string): SriResult[] | {
67
68
  error: string;
68
69
  };
70
+ type EtagAlgorithm = 'MD5' | 'SHA-1' | 'SHA-256';
71
+ declare const ETAG_ALGORITHMS: EtagAlgorithm[];
72
+ interface EtagResult {
73
+ algorithm: EtagAlgorithm;
74
+ weak: boolean;
75
+ hash: string;
76
+ etag: string;
77
+ headerName: 'ETag';
78
+ snippet: string;
79
+ }
80
+ /**
81
+ * Compute a content-hash ETag for the given content: digest it with the
82
+ * chosen algorithm, hex-encode it, and quote it into the exact string an
83
+ * ETag response header expects, with an optional weak-validator (W/)
84
+ * prefix. This hashes whatever content you give it; it does not replicate
85
+ * any specific web server's own ETag algorithm, which is often based on
86
+ * file size and modification time instead of content.
87
+ */
88
+ declare function generateEtag(content: string, algorithm?: EtagAlgorithm, weak?: boolean): EtagResult | {
89
+ error: string;
90
+ };
69
91
 
70
92
  type hashing_BcryptResult = BcryptResult;
93
+ declare const hashing_ETAG_ALGORITHMS: typeof ETAG_ALGORITHMS;
94
+ type hashing_EtagAlgorithm = EtagAlgorithm;
95
+ type hashing_EtagResult = EtagResult;
71
96
  declare const hashing_HASH_ALGORITHMS: typeof HASH_ALGORITHMS;
72
97
  declare const hashing_HASH_BITS: typeof HASH_BITS;
73
98
  type hashing_HashAlgorithm = HashAlgorithm;
@@ -80,6 +105,7 @@ type hashing_SriAlgorithm = SriAlgorithm;
80
105
  type hashing_SriResult = SriResult;
81
106
  declare const hashing_createEntry: typeof createEntry;
82
107
  declare const hashing_generateBcryptHash: typeof generateBcryptHash;
108
+ declare const hashing_generateEtag: typeof generateEtag;
83
109
  declare const hashing_generateHtpasswdFile: typeof generateHtpasswdFile;
84
110
  declare const hashing_generateMd5Hash: typeof generateMd5Hash;
85
111
  declare const hashing_generatePlain: typeof generatePlain;
@@ -95,7 +121,7 @@ declare const hashing_validateRounds: typeof validateRounds;
95
121
  declare const hashing_validateUsername: typeof validateUsername;
96
122
  declare const hashing_verifyPassword: typeof verifyPassword;
97
123
  declare namespace hashing {
98
- export { type hashing_BcryptResult as BcryptResult, hashing_HASH_ALGORITHMS as HASH_ALGORITHMS, hashing_HASH_BITS as HASH_BITS, type hashing_HashAlgorithm as HashAlgorithm, type hashing_HashResult as HashResult, type hashing_HtpasswdAlgorithm as HtpasswdAlgorithm, type hashing_HtpasswdEntry as HtpasswdEntry, hashing_ROUND_OPTIONS as ROUND_OPTIONS, hashing_SRI_ALGORITHMS as SRI_ALGORITHMS, type hashing_SriAlgorithm as SriAlgorithm, type hashing_SriResult as SriResult, hashing_createEntry as createEntry, hashing_generateBcryptHash as generateBcryptHash, hashing_generateHtpasswdFile as generateHtpasswdFile, hashing_generateMd5Hash as generateMd5Hash, hashing_generatePlain as generatePlain, hashing_generateSha1Hash as generateSha1Hash, hashing_generateSri as generateSri, hashing_generateSriAll as generateSriAll, hashing_hashAll as hashAll, hashing_hashOne as hashOne, hashing_hashPassword as hashPassword, hashing_hashWithTiming as hashWithTiming, hashing_parseHtpasswdFile as parseHtpasswdFile, hashing_validateRounds as validateRounds, hashing_validateUsername as validateUsername, hashing_verifyPassword as verifyPassword };
124
+ export { type hashing_BcryptResult as BcryptResult, hashing_ETAG_ALGORITHMS as ETAG_ALGORITHMS, type hashing_EtagAlgorithm as EtagAlgorithm, type hashing_EtagResult as EtagResult, hashing_HASH_ALGORITHMS as HASH_ALGORITHMS, hashing_HASH_BITS as HASH_BITS, type hashing_HashAlgorithm as HashAlgorithm, type hashing_HashResult as HashResult, type hashing_HtpasswdAlgorithm as HtpasswdAlgorithm, type hashing_HtpasswdEntry as HtpasswdEntry, hashing_ROUND_OPTIONS as ROUND_OPTIONS, hashing_SRI_ALGORITHMS as SRI_ALGORITHMS, type hashing_SriAlgorithm as SriAlgorithm, type hashing_SriResult as SriResult, hashing_createEntry as createEntry, hashing_generateBcryptHash as generateBcryptHash, hashing_generateEtag as generateEtag, hashing_generateHtpasswdFile as generateHtpasswdFile, hashing_generateMd5Hash as generateMd5Hash, hashing_generatePlain as generatePlain, hashing_generateSha1Hash as generateSha1Hash, hashing_generateSri as generateSri, hashing_generateSriAll as generateSriAll, hashing_hashAll as hashAll, hashing_hashOne as hashOne, hashing_hashPassword as hashPassword, hashing_hashWithTiming as hashWithTiming, hashing_parseHtpasswdFile as parseHtpasswdFile, hashing_validateRounds as validateRounds, hashing_validateUsername as validateUsername, hashing_verifyPassword as verifyPassword };
99
125
  }
100
126
 
101
- export { type BcryptResult as B, HASH_ALGORITHMS as H, ROUND_OPTIONS as R, SRI_ALGORITHMS as S, HASH_BITS as a, type HashAlgorithm as b, type HashResult as c, type HtpasswdAlgorithm as d, type HtpasswdEntry as e, type SriAlgorithm as f, type SriResult as g, hashing as h, createEntry as i, generateBcryptHash as j, generateHtpasswdFile as k, generateMd5Hash as l, generatePlain as m, generateSha1Hash as n, generateSri as o, generateSriAll as p, hashAll as q, hashOne as r, hashPassword as s, hashWithTiming as t, parseHtpasswdFile as u, validateRounds as v, validateUsername as w, verifyPassword as x };
127
+ export { verifyPassword as A, type BcryptResult as B, ETAG_ALGORITHMS as E, HASH_ALGORITHMS as H, ROUND_OPTIONS as R, SRI_ALGORITHMS as S, type EtagAlgorithm as a, type EtagResult as b, HASH_BITS as c, type HashAlgorithm as d, type HashResult as e, type HtpasswdAlgorithm as f, type HtpasswdEntry as g, hashing as h, type SriAlgorithm as i, type SriResult as j, createEntry as k, generateBcryptHash as l, generateEtag as m, generateHtpasswdFile as n, generateMd5Hash as o, generatePlain as p, generateSha1Hash as q, generateSri as r, generateSriAll as s, hashAll as t, hashOne as u, hashPassword as v, hashWithTiming as w, parseHtpasswdFile as x, validateRounds as y, validateUsername as z };
@@ -8,6 +8,7 @@
8
8
  * generatePlain, createEntry, parseHtpasswdFile,
9
9
  * generateHtpasswdFile, validateUsername
10
10
  * - sri-hash-generator: generateSri, generateSriAll (SHA-256/384/512 Subresource Integrity hashes)
11
+ * - etag-generator : generateEtag (MD5/SHA-1/SHA-256 content-hash ETag header values)
11
12
  */
12
13
  type HashAlgorithm = 'MD5' | 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
13
14
  declare const HASH_ALGORITHMS: HashAlgorithm[];
@@ -66,8 +67,32 @@ declare function generateSri(content: string, algorithm?: SriAlgorithm): SriResu
66
67
  declare function generateSriAll(content: string): SriResult[] | {
67
68
  error: string;
68
69
  };
70
+ type EtagAlgorithm = 'MD5' | 'SHA-1' | 'SHA-256';
71
+ declare const ETAG_ALGORITHMS: EtagAlgorithm[];
72
+ interface EtagResult {
73
+ algorithm: EtagAlgorithm;
74
+ weak: boolean;
75
+ hash: string;
76
+ etag: string;
77
+ headerName: 'ETag';
78
+ snippet: string;
79
+ }
80
+ /**
81
+ * Compute a content-hash ETag for the given content: digest it with the
82
+ * chosen algorithm, hex-encode it, and quote it into the exact string an
83
+ * ETag response header expects, with an optional weak-validator (W/)
84
+ * prefix. This hashes whatever content you give it; it does not replicate
85
+ * any specific web server's own ETag algorithm, which is often based on
86
+ * file size and modification time instead of content.
87
+ */
88
+ declare function generateEtag(content: string, algorithm?: EtagAlgorithm, weak?: boolean): EtagResult | {
89
+ error: string;
90
+ };
69
91
 
70
92
  type hashing_BcryptResult = BcryptResult;
93
+ declare const hashing_ETAG_ALGORITHMS: typeof ETAG_ALGORITHMS;
94
+ type hashing_EtagAlgorithm = EtagAlgorithm;
95
+ type hashing_EtagResult = EtagResult;
71
96
  declare const hashing_HASH_ALGORITHMS: typeof HASH_ALGORITHMS;
72
97
  declare const hashing_HASH_BITS: typeof HASH_BITS;
73
98
  type hashing_HashAlgorithm = HashAlgorithm;
@@ -80,6 +105,7 @@ type hashing_SriAlgorithm = SriAlgorithm;
80
105
  type hashing_SriResult = SriResult;
81
106
  declare const hashing_createEntry: typeof createEntry;
82
107
  declare const hashing_generateBcryptHash: typeof generateBcryptHash;
108
+ declare const hashing_generateEtag: typeof generateEtag;
83
109
  declare const hashing_generateHtpasswdFile: typeof generateHtpasswdFile;
84
110
  declare const hashing_generateMd5Hash: typeof generateMd5Hash;
85
111
  declare const hashing_generatePlain: typeof generatePlain;
@@ -95,7 +121,7 @@ declare const hashing_validateRounds: typeof validateRounds;
95
121
  declare const hashing_validateUsername: typeof validateUsername;
96
122
  declare const hashing_verifyPassword: typeof verifyPassword;
97
123
  declare namespace hashing {
98
- export { type hashing_BcryptResult as BcryptResult, hashing_HASH_ALGORITHMS as HASH_ALGORITHMS, hashing_HASH_BITS as HASH_BITS, type hashing_HashAlgorithm as HashAlgorithm, type hashing_HashResult as HashResult, type hashing_HtpasswdAlgorithm as HtpasswdAlgorithm, type hashing_HtpasswdEntry as HtpasswdEntry, hashing_ROUND_OPTIONS as ROUND_OPTIONS, hashing_SRI_ALGORITHMS as SRI_ALGORITHMS, type hashing_SriAlgorithm as SriAlgorithm, type hashing_SriResult as SriResult, hashing_createEntry as createEntry, hashing_generateBcryptHash as generateBcryptHash, hashing_generateHtpasswdFile as generateHtpasswdFile, hashing_generateMd5Hash as generateMd5Hash, hashing_generatePlain as generatePlain, hashing_generateSha1Hash as generateSha1Hash, hashing_generateSri as generateSri, hashing_generateSriAll as generateSriAll, hashing_hashAll as hashAll, hashing_hashOne as hashOne, hashing_hashPassword as hashPassword, hashing_hashWithTiming as hashWithTiming, hashing_parseHtpasswdFile as parseHtpasswdFile, hashing_validateRounds as validateRounds, hashing_validateUsername as validateUsername, hashing_verifyPassword as verifyPassword };
124
+ export { type hashing_BcryptResult as BcryptResult, hashing_ETAG_ALGORITHMS as ETAG_ALGORITHMS, type hashing_EtagAlgorithm as EtagAlgorithm, type hashing_EtagResult as EtagResult, hashing_HASH_ALGORITHMS as HASH_ALGORITHMS, hashing_HASH_BITS as HASH_BITS, type hashing_HashAlgorithm as HashAlgorithm, type hashing_HashResult as HashResult, type hashing_HtpasswdAlgorithm as HtpasswdAlgorithm, type hashing_HtpasswdEntry as HtpasswdEntry, hashing_ROUND_OPTIONS as ROUND_OPTIONS, hashing_SRI_ALGORITHMS as SRI_ALGORITHMS, type hashing_SriAlgorithm as SriAlgorithm, type hashing_SriResult as SriResult, hashing_createEntry as createEntry, hashing_generateBcryptHash as generateBcryptHash, hashing_generateEtag as generateEtag, hashing_generateHtpasswdFile as generateHtpasswdFile, hashing_generateMd5Hash as generateMd5Hash, hashing_generatePlain as generatePlain, hashing_generateSha1Hash as generateSha1Hash, hashing_generateSri as generateSri, hashing_generateSriAll as generateSriAll, hashing_hashAll as hashAll, hashing_hashOne as hashOne, hashing_hashPassword as hashPassword, hashing_hashWithTiming as hashWithTiming, hashing_parseHtpasswdFile as parseHtpasswdFile, hashing_validateRounds as validateRounds, hashing_validateUsername as validateUsername, hashing_verifyPassword as verifyPassword };
99
125
  }
100
126
 
101
- export { type BcryptResult as B, HASH_ALGORITHMS as H, ROUND_OPTIONS as R, SRI_ALGORITHMS as S, HASH_BITS as a, type HashAlgorithm as b, type HashResult as c, type HtpasswdAlgorithm as d, type HtpasswdEntry as e, type SriAlgorithm as f, type SriResult as g, hashing as h, createEntry as i, generateBcryptHash as j, generateHtpasswdFile as k, generateMd5Hash as l, generatePlain as m, generateSha1Hash as n, generateSri as o, generateSriAll as p, hashAll as q, hashOne as r, hashPassword as s, hashWithTiming as t, parseHtpasswdFile as u, validateRounds as v, validateUsername as w, verifyPassword as x };
127
+ export { verifyPassword as A, type BcryptResult as B, ETAG_ALGORITHMS as E, HASH_ALGORITHMS as H, ROUND_OPTIONS as R, SRI_ALGORITHMS as S, type EtagAlgorithm as a, type EtagResult as b, HASH_BITS as c, type HashAlgorithm as d, type HashResult as e, type HtpasswdAlgorithm as f, type HtpasswdEntry as g, hashing as h, type SriAlgorithm as i, type SriResult as j, createEntry as k, generateBcryptHash as l, generateEtag as m, generateHtpasswdFile as n, generateMd5Hash as o, generatePlain as p, generateSha1Hash as q, generateSri as r, generateSriAll as s, hashAll as t, hashOne as u, hashPassword as v, hashWithTiming as w, parseHtpasswdFile as x, validateRounds as y, validateUsername as z };
package/dist/index.cjs CHANGED
@@ -1766,12 +1766,14 @@ function base62Decode(input) {
1766
1766
  // src/tools/hashing.ts
1767
1767
  var hashing_exports = {};
1768
1768
  __export(hashing_exports, {
1769
+ ETAG_ALGORITHMS: () => ETAG_ALGORITHMS,
1769
1770
  HASH_ALGORITHMS: () => HASH_ALGORITHMS,
1770
1771
  HASH_BITS: () => HASH_BITS,
1771
1772
  ROUND_OPTIONS: () => ROUND_OPTIONS,
1772
1773
  SRI_ALGORITHMS: () => SRI_ALGORITHMS,
1773
1774
  createEntry: () => createEntry,
1774
1775
  generateBcryptHash: () => generateBcryptHash,
1776
+ generateEtag: () => generateEtag,
1775
1777
  generateHtpasswdFile: () => generateHtpasswdFile,
1776
1778
  generateMd5Hash: () => generateMd5Hash,
1777
1779
  generatePlain: () => generatePlain,
@@ -2032,6 +2034,24 @@ function generateSriAll(content) {
2032
2034
  }
2033
2035
  return SRI_ALGORITHMS.map((alg) => generateSri(content, alg));
2034
2036
  }
2037
+ var ETAG_ALGORITHMS = ["MD5", "SHA-1", "SHA-256"];
2038
+ var ETAG_NODE_ALG_MAP = {
2039
+ "MD5": "md5",
2040
+ "SHA-1": "sha1",
2041
+ "SHA-256": "sha256"
2042
+ };
2043
+ function generateEtag(content, algorithm = "SHA-1", weak = false) {
2044
+ if (typeof content !== "string" || content.length === 0) {
2045
+ return { error: "Content is required" };
2046
+ }
2047
+ if (!ETAG_ALGORITHMS.includes(algorithm)) {
2048
+ return { error: `Unknown algorithm: ${algorithm}. Must be one of ${ETAG_ALGORITHMS.join(", ")}` };
2049
+ }
2050
+ const hash = crypto.createHash(ETAG_NODE_ALG_MAP[algorithm]).update(content, "utf8").digest("hex");
2051
+ const quoted = `"${hash}"`;
2052
+ const etag = weak ? `W/${quoted}` : quoted;
2053
+ return { algorithm, weak, hash, etag, headerName: "ETag", snippet: `ETag: ${etag}` };
2054
+ }
2035
2055
 
2036
2056
  // src/tools/text.ts
2037
2057
  var text_exports = {};
@@ -7911,12 +7931,15 @@ __export(units_exports, {
7911
7931
  COMMON_TAX_RATES: () => COMMON_TAX_RATES,
7912
7932
  COMMON_TIP_PERCENTAGES: () => COMMON_TIP_PERCENTAGES,
7913
7933
  COMMON_VIEWPORTS: () => COMMON_VIEWPORTS,
7934
+ USD_DENOMINATIONS: () => USD_DENOMINATIONS,
7914
7935
  applySuccessiveDiscounts: () => applySuccessiveDiscounts,
7915
7936
  autoFormat: () => autoFormat,
7916
7937
  bumpVersion: () => bumpVersion,
7917
7938
  calcAspectRatio: () => calcAspectRatio,
7918
7939
  calcSubnet: () => calcSubnet,
7919
7940
  calculateBreakEven: () => calculateBreakEven,
7941
+ calculateCashBreakdown: () => calculateCashBreakdown,
7942
+ calculateChange: () => calculateChange,
7920
7943
  calculateCompoundInterest: () => calculateCompoundInterest,
7921
7944
  calculateDiscount: () => calculateDiscount,
7922
7945
  calculateEmi: () => calculateEmi,
@@ -9764,6 +9787,64 @@ function compareUnitPrices(items) {
9764
9787
  const bestLabel = results.find((r) => r.isBest).label;
9765
9788
  return { items: results, bestLabel };
9766
9789
  }
9790
+ var USD_DENOMINATIONS = [100, 50, 20, 10, 5, 1, 0.25, 0.1, 0.05, 0.01];
9791
+ function _cashToCents(n) {
9792
+ return Math.round(n * 100);
9793
+ }
9794
+ function calculateCashBreakdown(amount, denominations) {
9795
+ if (!Number.isFinite(amount) || amount < 0) return { error: "Amount must be zero or a positive number" };
9796
+ if (!Array.isArray(denominations) || denominations.length === 0) {
9797
+ return { error: "At least one denomination is required" };
9798
+ }
9799
+ for (const d of denominations) {
9800
+ if (typeof d !== "number" || !Number.isFinite(d) || d <= 0) {
9801
+ return { error: "Each denomination must be a positive number" };
9802
+ }
9803
+ }
9804
+ const round23 = (n) => Math.round(n * 100) / 100;
9805
+ const sorted = Array.from(new Set(denominations)).sort((a, b) => b - a);
9806
+ let remainingCents = _cashToCents(amount);
9807
+ const breakdown = [];
9808
+ let totalCount = 0;
9809
+ for (const d of sorted) {
9810
+ const dCents = _cashToCents(d);
9811
+ const count = Math.floor(remainingCents / dCents);
9812
+ if (count > 0) {
9813
+ breakdown.push({ denomination: d, count, subtotal: round23(count * d) });
9814
+ remainingCents -= count * dCents;
9815
+ totalCount += count;
9816
+ }
9817
+ }
9818
+ return {
9819
+ amount: round23(amount),
9820
+ denominations: sorted,
9821
+ breakdown,
9822
+ totalCount,
9823
+ remainder: round23(remainingCents / 100)
9824
+ };
9825
+ }
9826
+ function calculateChange(amountDue, amountTendered, denominations) {
9827
+ if (!Number.isFinite(amountDue) || amountDue < 0) return { error: "Amount due must be zero or a positive number" };
9828
+ if (!Number.isFinite(amountTendered) || amountTendered < 0) {
9829
+ return { error: "Amount tendered must be zero or a positive number" };
9830
+ }
9831
+ if (_cashToCents(amountTendered) < _cashToCents(amountDue)) {
9832
+ return { error: "Amount tendered must be greater than or equal to the amount due" };
9833
+ }
9834
+ const round23 = (n) => Math.round(n * 100) / 100;
9835
+ const changeDue = round23(amountTendered - amountDue);
9836
+ const breakdown = calculateCashBreakdown(changeDue, denominations);
9837
+ if ("error" in breakdown) return breakdown;
9838
+ return {
9839
+ amountDue: round23(amountDue),
9840
+ amountTendered: round23(amountTendered),
9841
+ changeDue,
9842
+ denominations: breakdown.denominations,
9843
+ breakdown: breakdown.breakdown,
9844
+ totalCount: breakdown.totalCount,
9845
+ remainder: breakdown.remainder
9846
+ };
9847
+ }
9767
9848
 
9768
9849
  // src/tools/network.ts
9769
9850
  var network_exports = {};
package/dist/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
1
  export { j as json } from './json-Ta9JykSB.cjs';
2
2
  export { e as encoding } from './encoding-Dk3wpmb3.cjs';
3
- export { h as hashing } from './hashing-Dnj0IAZf.cjs';
3
+ export { h as hashing } from './hashing-CJjlvqS_.cjs';
4
4
  export { t as text } from './text-kHkT9VtT.cjs';
5
5
  export { d as data } from './data-BCf3dm-E.cjs';
6
6
  export { g as generators } from './generators-Du8cBesn.cjs';
7
7
  export { t as time } from './time-KqJjdqII.cjs';
8
- export { u as units } from './units-HQrMCiNM.cjs';
8
+ export { u as units } from './units-CzPwRC03.cjs';
9
9
  export { n as network } from './network-CKPoesdD.cjs';
10
10
  export { a as api } from './api-DmTNE4c1.cjs';
11
11
  export { c as code } from './code-KXoRsHtl.cjs';
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export { j as json } from './json-Ta9JykSB.js';
2
2
  export { e as encoding } from './encoding-Dk3wpmb3.js';
3
- export { h as hashing } from './hashing-Dnj0IAZf.js';
3
+ export { h as hashing } from './hashing-CJjlvqS_.js';
4
4
  export { t as text } from './text-kHkT9VtT.js';
5
5
  export { d as data } from './data-BCf3dm-E.js';
6
6
  export { g as generators } from './generators-Du8cBesn.js';
7
7
  export { t as time } from './time-KqJjdqII.js';
8
- export { u as units } from './units-HQrMCiNM.js';
8
+ export { u as units } from './units-CzPwRC03.js';
9
9
  export { n as network } from './network-CKPoesdD.js';
10
10
  export { a as api } from './api-DmTNE4c1.js';
11
11
  export { c as code } from './code-KXoRsHtl.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { media_exports as media } from './chunk-L6V4W4SU.js';
2
- export { units_exports as units } from './chunk-47RI5V3B.js';
2
+ export { units_exports as units } from './chunk-2MTHD2LG.js';
3
3
  export { network_exports as network } from './chunk-Y4BVU76A.js';
4
4
  export { api_exports as api } from './chunk-52ZDKSIX.js';
5
5
  export { code_exports as code } from './chunk-JL7YTXRB.js';
@@ -9,7 +9,7 @@ export { misc_exports as misc } from './chunk-GX7H6TAX.js';
9
9
  export { ai_agent_exports as ai_agent } from './chunk-W3J7GZVQ.js';
10
10
  export { json_exports as json } from './chunk-WVEKRKGU.js';
11
11
  export { encoding_exports as encoding } from './chunk-DOWQZUTP.js';
12
- export { hashing_exports as hashing } from './chunk-VEVNIGJ6.js';
12
+ export { hashing_exports as hashing } from './chunk-PET2CGTH.js';
13
13
  export { text_exports as text } from './chunk-F2CEN226.js';
14
14
  export { data_exports as data } from './chunk-RZUNTYEH.js';
15
15
  export { generators_exports as generators } from './chunk-3TYWIX3B.js';
@@ -255,13 +255,33 @@ function generateSriAll(content) {
255
255
  }
256
256
  return SRI_ALGORITHMS.map((alg) => generateSri(content, alg));
257
257
  }
258
+ var ETAG_ALGORITHMS = ["MD5", "SHA-1", "SHA-256"];
259
+ var ETAG_NODE_ALG_MAP = {
260
+ "MD5": "md5",
261
+ "SHA-1": "sha1",
262
+ "SHA-256": "sha256"
263
+ };
264
+ function generateEtag(content, algorithm = "SHA-1", weak = false) {
265
+ if (typeof content !== "string" || content.length === 0) {
266
+ return { error: "Content is required" };
267
+ }
268
+ if (!ETAG_ALGORITHMS.includes(algorithm)) {
269
+ return { error: `Unknown algorithm: ${algorithm}. Must be one of ${ETAG_ALGORITHMS.join(", ")}` };
270
+ }
271
+ const hash = crypto.createHash(ETAG_NODE_ALG_MAP[algorithm]).update(content, "utf8").digest("hex");
272
+ const quoted = `"${hash}"`;
273
+ const etag = weak ? `W/${quoted}` : quoted;
274
+ return { algorithm, weak, hash, etag, headerName: "ETag", snippet: `ETag: ${etag}` };
275
+ }
258
276
 
277
+ exports.ETAG_ALGORITHMS = ETAG_ALGORITHMS;
259
278
  exports.HASH_ALGORITHMS = HASH_ALGORITHMS;
260
279
  exports.HASH_BITS = HASH_BITS;
261
280
  exports.ROUND_OPTIONS = ROUND_OPTIONS;
262
281
  exports.SRI_ALGORITHMS = SRI_ALGORITHMS;
263
282
  exports.createEntry = createEntry;
264
283
  exports.generateBcryptHash = generateBcryptHash;
284
+ exports.generateEtag = generateEtag;
265
285
  exports.generateHtpasswdFile = generateHtpasswdFile;
266
286
  exports.generateMd5Hash = generateMd5Hash;
267
287
  exports.generatePlain = generatePlain;
@@ -1 +1 @@
1
- export { B as BcryptResult, H as HASH_ALGORITHMS, a as HASH_BITS, b as HashAlgorithm, c as HashResult, d as HtpasswdAlgorithm, e as HtpasswdEntry, R as ROUND_OPTIONS, S as SRI_ALGORITHMS, f as SriAlgorithm, g as SriResult, i as createEntry, j as generateBcryptHash, k as generateHtpasswdFile, l as generateMd5Hash, m as generatePlain, n as generateSha1Hash, o as generateSri, p as generateSriAll, q as hashAll, r as hashOne, s as hashPassword, t as hashWithTiming, u as parseHtpasswdFile, v as validateRounds, w as validateUsername, x as verifyPassword } from '../hashing-Dnj0IAZf.cjs';
1
+ export { B as BcryptResult, E as ETAG_ALGORITHMS, a as EtagAlgorithm, b as EtagResult, H as HASH_ALGORITHMS, c as HASH_BITS, d as HashAlgorithm, e as HashResult, f as HtpasswdAlgorithm, g as HtpasswdEntry, R as ROUND_OPTIONS, S as SRI_ALGORITHMS, i as SriAlgorithm, j as SriResult, k as createEntry, l as generateBcryptHash, m as generateEtag, n as generateHtpasswdFile, o as generateMd5Hash, p as generatePlain, q as generateSha1Hash, r as generateSri, s as generateSriAll, t as hashAll, u as hashOne, v as hashPassword, w as hashWithTiming, x as parseHtpasswdFile, y as validateRounds, z as validateUsername, A as verifyPassword } from '../hashing-CJjlvqS_.cjs';
@@ -1 +1 @@
1
- export { B as BcryptResult, H as HASH_ALGORITHMS, a as HASH_BITS, b as HashAlgorithm, c as HashResult, d as HtpasswdAlgorithm, e as HtpasswdEntry, R as ROUND_OPTIONS, S as SRI_ALGORITHMS, f as SriAlgorithm, g as SriResult, i as createEntry, j as generateBcryptHash, k as generateHtpasswdFile, l as generateMd5Hash, m as generatePlain, n as generateSha1Hash, o as generateSri, p as generateSriAll, q as hashAll, r as hashOne, s as hashPassword, t as hashWithTiming, u as parseHtpasswdFile, v as validateRounds, w as validateUsername, x as verifyPassword } from '../hashing-Dnj0IAZf.js';
1
+ export { B as BcryptResult, E as ETAG_ALGORITHMS, a as EtagAlgorithm, b as EtagResult, H as HASH_ALGORITHMS, c as HASH_BITS, d as HashAlgorithm, e as HashResult, f as HtpasswdAlgorithm, g as HtpasswdEntry, R as ROUND_OPTIONS, S as SRI_ALGORITHMS, i as SriAlgorithm, j as SriResult, k as createEntry, l as generateBcryptHash, m as generateEtag, n as generateHtpasswdFile, o as generateMd5Hash, p as generatePlain, q as generateSha1Hash, r as generateSri, s as generateSriAll, t as hashAll, u as hashOne, v as hashPassword, w as hashWithTiming, x as parseHtpasswdFile, y as validateRounds, z as validateUsername, A as verifyPassword } from '../hashing-CJjlvqS_.js';
@@ -1,2 +1,2 @@
1
- export { HASH_ALGORITHMS, HASH_BITS, ROUND_OPTIONS, SRI_ALGORITHMS, createEntry, generateBcryptHash, generateHtpasswdFile, generateMd5Hash, generatePlain, generateSha1Hash, generateSri, generateSriAll, hashAll, hashOne, hashPassword, hashWithTiming, parseHtpasswdFile, validateRounds, validateUsername, verifyPassword } from '../chunk-VEVNIGJ6.js';
1
+ export { ETAG_ALGORITHMS, HASH_ALGORITHMS, HASH_BITS, ROUND_OPTIONS, SRI_ALGORITHMS, createEntry, generateBcryptHash, generateEtag, generateHtpasswdFile, generateMd5Hash, generatePlain, generateSha1Hash, generateSri, generateSriAll, hashAll, hashOne, hashPassword, hashWithTiming, parseHtpasswdFile, validateRounds, validateUsername, verifyPassword } from '../chunk-PET2CGTH.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -1780,6 +1780,64 @@ function compareUnitPrices(items) {
1780
1780
  const bestLabel = results.find((r) => r.isBest).label;
1781
1781
  return { items: results, bestLabel };
1782
1782
  }
1783
+ var USD_DENOMINATIONS = [100, 50, 20, 10, 5, 1, 0.25, 0.1, 0.05, 0.01];
1784
+ function _cashToCents(n) {
1785
+ return Math.round(n * 100);
1786
+ }
1787
+ function calculateCashBreakdown(amount, denominations) {
1788
+ if (!Number.isFinite(amount) || amount < 0) return { error: "Amount must be zero or a positive number" };
1789
+ if (!Array.isArray(denominations) || denominations.length === 0) {
1790
+ return { error: "At least one denomination is required" };
1791
+ }
1792
+ for (const d of denominations) {
1793
+ if (typeof d !== "number" || !Number.isFinite(d) || d <= 0) {
1794
+ return { error: "Each denomination must be a positive number" };
1795
+ }
1796
+ }
1797
+ const round22 = (n) => Math.round(n * 100) / 100;
1798
+ const sorted = Array.from(new Set(denominations)).sort((a, b) => b - a);
1799
+ let remainingCents = _cashToCents(amount);
1800
+ const breakdown = [];
1801
+ let totalCount = 0;
1802
+ for (const d of sorted) {
1803
+ const dCents = _cashToCents(d);
1804
+ const count = Math.floor(remainingCents / dCents);
1805
+ if (count > 0) {
1806
+ breakdown.push({ denomination: d, count, subtotal: round22(count * d) });
1807
+ remainingCents -= count * dCents;
1808
+ totalCount += count;
1809
+ }
1810
+ }
1811
+ return {
1812
+ amount: round22(amount),
1813
+ denominations: sorted,
1814
+ breakdown,
1815
+ totalCount,
1816
+ remainder: round22(remainingCents / 100)
1817
+ };
1818
+ }
1819
+ function calculateChange(amountDue, amountTendered, denominations) {
1820
+ if (!Number.isFinite(amountDue) || amountDue < 0) return { error: "Amount due must be zero or a positive number" };
1821
+ if (!Number.isFinite(amountTendered) || amountTendered < 0) {
1822
+ return { error: "Amount tendered must be zero or a positive number" };
1823
+ }
1824
+ if (_cashToCents(amountTendered) < _cashToCents(amountDue)) {
1825
+ return { error: "Amount tendered must be greater than or equal to the amount due" };
1826
+ }
1827
+ const round22 = (n) => Math.round(n * 100) / 100;
1828
+ const changeDue = round22(amountTendered - amountDue);
1829
+ const breakdown = calculateCashBreakdown(changeDue, denominations);
1830
+ if ("error" in breakdown) return breakdown;
1831
+ return {
1832
+ amountDue: round22(amountDue),
1833
+ amountTendered: round22(amountTendered),
1834
+ changeDue,
1835
+ denominations: breakdown.denominations,
1836
+ breakdown: breakdown.breakdown,
1837
+ totalCount: breakdown.totalCount,
1838
+ remainder: breakdown.remainder
1839
+ };
1840
+ }
1783
1841
 
1784
1842
  exports.BASE_LABELS = BASE_LABELS;
1785
1843
  exports.BASE_PREFIXES = BASE_PREFIXES;
@@ -1792,12 +1850,15 @@ exports.COMMON_SIZES = COMMON_SIZES;
1792
1850
  exports.COMMON_TAX_RATES = COMMON_TAX_RATES;
1793
1851
  exports.COMMON_TIP_PERCENTAGES = COMMON_TIP_PERCENTAGES;
1794
1852
  exports.COMMON_VIEWPORTS = COMMON_VIEWPORTS;
1853
+ exports.USD_DENOMINATIONS = USD_DENOMINATIONS;
1795
1854
  exports.applySuccessiveDiscounts = applySuccessiveDiscounts;
1796
1855
  exports.autoFormat = autoFormat;
1797
1856
  exports.bumpVersion = bumpVersion;
1798
1857
  exports.calcAspectRatio = calcAspectRatio;
1799
1858
  exports.calcSubnet = calcSubnet;
1800
1859
  exports.calculateBreakEven = calculateBreakEven;
1860
+ exports.calculateCashBreakdown = calculateCashBreakdown;
1861
+ exports.calculateChange = calculateChange;
1801
1862
  exports.calculateCompoundInterest = calculateCompoundInterest;
1802
1863
  exports.calculateDiscount = calculateDiscount;
1803
1864
  exports.calculateEmi = calculateEmi;
@@ -1 +1 @@
1
- export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BreakEvenInput, j as BreakEvenResult, k as ByteConvertResult, l as ByteUnit, C as COMMON_CURRENCIES, m as COMMON_LOCALES, n as COMMON_PERMISSIONS, o as COMMON_RATIOS, p as COMMON_SIZES, q as COMMON_TAX_RATES, r as COMMON_TIP_PERCENTAGES, s as COMMON_VIEWPORTS, t as CardValidationResult, v as CompareUnitPricesResult, w as CompoundInterestResult, x as CompoundYearRow, D as Dimensions, y as DiscountField, z as DiscountInput, E as DiscountResult, F as EmiResult, G as EmiTenureUnit, H as EmiYearlyBreakdownRow, I as FilePermissions, J as FormatOptions, K as IbanValidationResult, L as IpConversion, M as IsbnFormat, N as IsbnResult, O as LoanResult, P as MarginMarkupField, Q as MarginMarkupInput, R as MarginMarkupResult, S as NotationStyle, T as NumberBase, U as PercentChangeDirection, V as PercentageChangeResult, W as Permission, X as PxConvertResult, Y as RoiInput, Z as RoiResult, _ as RuleOf72Direction, $ as RuleOf72Result, a0 as SavingsGoalInput, a1 as SavingsGoalMode, a2 as SavingsGoalResult, a3 as SemverVersion, a4 as SimpleInterestResult, a5 as SubnetInfo, a6 as SuccessiveDiscountResult, a7 as SuccessiveDiscountStep, a8 as TaxDirection, a9 as TaxResult, aa as TimeValueDirection, ab as TimeValueResult, ac as TipSplitResult, ad as UnitPriceItem, ae as UnitPriceResult, af as VideoBitrateInput, ag as VideoBitrateMode, ah as VideoBitrateResult, ai as ViewportConvertResult, aj as applySuccessiveDiscounts, ak as autoFormat, al as bumpVersion, am as calcAspectRatio, an as calcSubnet, ao as calculateBreakEven, ap as calculateCompoundInterest, aq as calculateDiscount, ar as calculateEmi, as as calculateLoan, at as calculateMarginMarkup, au as calculatePercentageChange, av as calculateRoi, aw as calculateRuleOf72, ax as calculateSavingsGoal, ay as calculateSimpleInterest, az as calculateTax, aA as calculateTimeValue, aB as calculateTipSplit, aC as calculateVideoBitrate, aD as compareSemver, aE as compareUnitPrices, aF as convert, aG as convertAprApy, aH as convertBytes, aI as convertIp, aJ as coverBox, aK as decimalToIp, aL as decimalToIpCidr, aM as describePermissions, aN as fitIntoBox, aO as formatNumber, aP as formatValue, aQ as formatVwValue, aR as formatWithSeparator, aS as gcd, aT as ipFromBinary, aU as ipFromDecimal, aV as ipFromHex, aW as ipToBinary, aX as ipToDecimal, aY as ipToDecimalCidr, aZ as ipToHex, a_ as ipToOctal, a$ as isValid, b0 as isValidCidr, b1 as isValidIp, b2 as isValidIpv4, b3 as marginToMarkup, b4 as markupToMargin, b5 as octalToPermissions, b6 as parseFileSize, b7 as parseInput, b8 as parseNumberString, b9 as parseSemver, ba as permissionsToChmod, bb as permissionsToOctal, bc as permissionsToSymbolic, bd as ptToPx, be as pxToAll, bf as pxToViewport, bg as remToPx, bh as satisfiesRange, bi as scaleByHeight, bj as scaleByWidth, bk as sortVersions, bl as splitSubnet, bm as symbolicToPermissions, bn as validateBarcode, bo as validateCardNumber, bp as validateIban, bq as validateIsbn, br as viewportToPx } from '../units-HQrMCiNM.cjs';
1
+ export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BreakEvenInput, j as BreakEvenResult, k as ByteConvertResult, l as ByteUnit, C as COMMON_CURRENCIES, m as COMMON_LOCALES, n as COMMON_PERMISSIONS, o as COMMON_RATIOS, p as COMMON_SIZES, q as COMMON_TAX_RATES, r as COMMON_TIP_PERCENTAGES, s as COMMON_VIEWPORTS, t as CardValidationResult, v as CashBreakdownResult, w as CashChangeResult, x as CashDenominationItem, y as CompareUnitPricesResult, z as CompoundInterestResult, D as CompoundYearRow, E as Dimensions, F as DiscountField, G as DiscountInput, H as DiscountResult, I as EmiResult, J as EmiTenureUnit, K as EmiYearlyBreakdownRow, L as FilePermissions, M as FormatOptions, N as IbanValidationResult, O as IpConversion, P as IsbnFormat, Q as IsbnResult, R as LoanResult, S as MarginMarkupField, T as MarginMarkupInput, U as MarginMarkupResult, V as NotationStyle, W as NumberBase, X as PercentChangeDirection, Y as PercentageChangeResult, Z as Permission, _ as PxConvertResult, $ as RoiInput, a0 as RoiResult, a1 as RuleOf72Direction, a2 as RuleOf72Result, a3 as SavingsGoalInput, a4 as SavingsGoalMode, a5 as SavingsGoalResult, a6 as SemverVersion, a7 as SimpleInterestResult, a8 as SubnetInfo, a9 as SuccessiveDiscountResult, aa as SuccessiveDiscountStep, ab as TaxDirection, ac as TaxResult, ad as TimeValueDirection, ae as TimeValueResult, af as TipSplitResult, ag as USD_DENOMINATIONS, ah as UnitPriceItem, ai as UnitPriceResult, aj as VideoBitrateInput, ak as VideoBitrateMode, al as VideoBitrateResult, am as ViewportConvertResult, an as applySuccessiveDiscounts, ao as autoFormat, ap as bumpVersion, aq as calcAspectRatio, ar as calcSubnet, as as calculateBreakEven, at as calculateCashBreakdown, au as calculateChange, av as calculateCompoundInterest, aw as calculateDiscount, ax as calculateEmi, ay as calculateLoan, az as calculateMarginMarkup, aA as calculatePercentageChange, aB as calculateRoi, aC as calculateRuleOf72, aD as calculateSavingsGoal, aE as calculateSimpleInterest, aF as calculateTax, aG as calculateTimeValue, aH as calculateTipSplit, aI as calculateVideoBitrate, aJ as compareSemver, aK as compareUnitPrices, aL as convert, aM as convertAprApy, aN as convertBytes, aO as convertIp, aP as coverBox, aQ as decimalToIp, aR as decimalToIpCidr, aS as describePermissions, aT as fitIntoBox, aU as formatNumber, aV as formatValue, aW as formatVwValue, aX as formatWithSeparator, aY as gcd, aZ as ipFromBinary, a_ as ipFromDecimal, a$ as ipFromHex, b0 as ipToBinary, b1 as ipToDecimal, b2 as ipToDecimalCidr, b3 as ipToHex, b4 as ipToOctal, b5 as isValid, b6 as isValidCidr, b7 as isValidIp, b8 as isValidIpv4, b9 as marginToMarkup, ba as markupToMargin, bb as octalToPermissions, bc as parseFileSize, bd as parseInput, be as parseNumberString, bf as parseSemver, bg as permissionsToChmod, bh as permissionsToOctal, bi as permissionsToSymbolic, bj as ptToPx, bk as pxToAll, bl as pxToViewport, bm as remToPx, bn as satisfiesRange, bo as scaleByHeight, bp as scaleByWidth, bq as sortVersions, br as splitSubnet, bs as symbolicToPermissions, bt as validateBarcode, bu as validateCardNumber, bv as validateIban, bw as validateIsbn, bx as viewportToPx } from '../units-CzPwRC03.cjs';
@@ -1 +1 @@
1
- export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BreakEvenInput, j as BreakEvenResult, k as ByteConvertResult, l as ByteUnit, C as COMMON_CURRENCIES, m as COMMON_LOCALES, n as COMMON_PERMISSIONS, o as COMMON_RATIOS, p as COMMON_SIZES, q as COMMON_TAX_RATES, r as COMMON_TIP_PERCENTAGES, s as COMMON_VIEWPORTS, t as CardValidationResult, v as CompareUnitPricesResult, w as CompoundInterestResult, x as CompoundYearRow, D as Dimensions, y as DiscountField, z as DiscountInput, E as DiscountResult, F as EmiResult, G as EmiTenureUnit, H as EmiYearlyBreakdownRow, I as FilePermissions, J as FormatOptions, K as IbanValidationResult, L as IpConversion, M as IsbnFormat, N as IsbnResult, O as LoanResult, P as MarginMarkupField, Q as MarginMarkupInput, R as MarginMarkupResult, S as NotationStyle, T as NumberBase, U as PercentChangeDirection, V as PercentageChangeResult, W as Permission, X as PxConvertResult, Y as RoiInput, Z as RoiResult, _ as RuleOf72Direction, $ as RuleOf72Result, a0 as SavingsGoalInput, a1 as SavingsGoalMode, a2 as SavingsGoalResult, a3 as SemverVersion, a4 as SimpleInterestResult, a5 as SubnetInfo, a6 as SuccessiveDiscountResult, a7 as SuccessiveDiscountStep, a8 as TaxDirection, a9 as TaxResult, aa as TimeValueDirection, ab as TimeValueResult, ac as TipSplitResult, ad as UnitPriceItem, ae as UnitPriceResult, af as VideoBitrateInput, ag as VideoBitrateMode, ah as VideoBitrateResult, ai as ViewportConvertResult, aj as applySuccessiveDiscounts, ak as autoFormat, al as bumpVersion, am as calcAspectRatio, an as calcSubnet, ao as calculateBreakEven, ap as calculateCompoundInterest, aq as calculateDiscount, ar as calculateEmi, as as calculateLoan, at as calculateMarginMarkup, au as calculatePercentageChange, av as calculateRoi, aw as calculateRuleOf72, ax as calculateSavingsGoal, ay as calculateSimpleInterest, az as calculateTax, aA as calculateTimeValue, aB as calculateTipSplit, aC as calculateVideoBitrate, aD as compareSemver, aE as compareUnitPrices, aF as convert, aG as convertAprApy, aH as convertBytes, aI as convertIp, aJ as coverBox, aK as decimalToIp, aL as decimalToIpCidr, aM as describePermissions, aN as fitIntoBox, aO as formatNumber, aP as formatValue, aQ as formatVwValue, aR as formatWithSeparator, aS as gcd, aT as ipFromBinary, aU as ipFromDecimal, aV as ipFromHex, aW as ipToBinary, aX as ipToDecimal, aY as ipToDecimalCidr, aZ as ipToHex, a_ as ipToOctal, a$ as isValid, b0 as isValidCidr, b1 as isValidIp, b2 as isValidIpv4, b3 as marginToMarkup, b4 as markupToMargin, b5 as octalToPermissions, b6 as parseFileSize, b7 as parseInput, b8 as parseNumberString, b9 as parseSemver, ba as permissionsToChmod, bb as permissionsToOctal, bc as permissionsToSymbolic, bd as ptToPx, be as pxToAll, bf as pxToViewport, bg as remToPx, bh as satisfiesRange, bi as scaleByHeight, bj as scaleByWidth, bk as sortVersions, bl as splitSubnet, bm as symbolicToPermissions, bn as validateBarcode, bo as validateCardNumber, bp as validateIban, bq as validateIsbn, br as viewportToPx } from '../units-HQrMCiNM.js';
1
+ export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BreakEvenInput, j as BreakEvenResult, k as ByteConvertResult, l as ByteUnit, C as COMMON_CURRENCIES, m as COMMON_LOCALES, n as COMMON_PERMISSIONS, o as COMMON_RATIOS, p as COMMON_SIZES, q as COMMON_TAX_RATES, r as COMMON_TIP_PERCENTAGES, s as COMMON_VIEWPORTS, t as CardValidationResult, v as CashBreakdownResult, w as CashChangeResult, x as CashDenominationItem, y as CompareUnitPricesResult, z as CompoundInterestResult, D as CompoundYearRow, E as Dimensions, F as DiscountField, G as DiscountInput, H as DiscountResult, I as EmiResult, J as EmiTenureUnit, K as EmiYearlyBreakdownRow, L as FilePermissions, M as FormatOptions, N as IbanValidationResult, O as IpConversion, P as IsbnFormat, Q as IsbnResult, R as LoanResult, S as MarginMarkupField, T as MarginMarkupInput, U as MarginMarkupResult, V as NotationStyle, W as NumberBase, X as PercentChangeDirection, Y as PercentageChangeResult, Z as Permission, _ as PxConvertResult, $ as RoiInput, a0 as RoiResult, a1 as RuleOf72Direction, a2 as RuleOf72Result, a3 as SavingsGoalInput, a4 as SavingsGoalMode, a5 as SavingsGoalResult, a6 as SemverVersion, a7 as SimpleInterestResult, a8 as SubnetInfo, a9 as SuccessiveDiscountResult, aa as SuccessiveDiscountStep, ab as TaxDirection, ac as TaxResult, ad as TimeValueDirection, ae as TimeValueResult, af as TipSplitResult, ag as USD_DENOMINATIONS, ah as UnitPriceItem, ai as UnitPriceResult, aj as VideoBitrateInput, ak as VideoBitrateMode, al as VideoBitrateResult, am as ViewportConvertResult, an as applySuccessiveDiscounts, ao as autoFormat, ap as bumpVersion, aq as calcAspectRatio, ar as calcSubnet, as as calculateBreakEven, at as calculateCashBreakdown, au as calculateChange, av as calculateCompoundInterest, aw as calculateDiscount, ax as calculateEmi, ay as calculateLoan, az as calculateMarginMarkup, aA as calculatePercentageChange, aB as calculateRoi, aC as calculateRuleOf72, aD as calculateSavingsGoal, aE as calculateSimpleInterest, aF as calculateTax, aG as calculateTimeValue, aH as calculateTipSplit, aI as calculateVideoBitrate, aJ as compareSemver, aK as compareUnitPrices, aL as convert, aM as convertAprApy, aN as convertBytes, aO as convertIp, aP as coverBox, aQ as decimalToIp, aR as decimalToIpCidr, aS as describePermissions, aT as fitIntoBox, aU as formatNumber, aV as formatValue, aW as formatVwValue, aX as formatWithSeparator, aY as gcd, aZ as ipFromBinary, a_ as ipFromDecimal, a$ as ipFromHex, b0 as ipToBinary, b1 as ipToDecimal, b2 as ipToDecimalCidr, b3 as ipToHex, b4 as ipToOctal, b5 as isValid, b6 as isValidCidr, b7 as isValidIp, b8 as isValidIpv4, b9 as marginToMarkup, ba as markupToMargin, bb as octalToPermissions, bc as parseFileSize, bd as parseInput, be as parseNumberString, bf as parseSemver, bg as permissionsToChmod, bh as permissionsToOctal, bi as permissionsToSymbolic, bj as ptToPx, bk as pxToAll, bl as pxToViewport, bm as remToPx, bn as satisfiesRange, bo as scaleByHeight, bp as scaleByWidth, bq as sortVersions, br as splitSubnet, bs as symbolicToPermissions, bt as validateBarcode, bu as validateCardNumber, bv as validateIban, bw as validateIsbn, bx as viewportToPx } from '../units-CzPwRC03.js';
@@ -1,2 +1,2 @@
1
- export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCompoundInterest, calculateDiscount, calculateEmi, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-47RI5V3B.js';
1
+ export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCashBreakdown, calculateChange, calculateCompoundInterest, calculateDiscount, calculateEmi, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-2MTHD2LG.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -32,6 +32,7 @@
32
32
  * - savings-goal-calculator : calculateSavingsGoal
33
33
  * - roi-calculator : calculateRoi
34
34
  * - unit-price-comparator : compareUnitPrices
35
+ * - cash-till-calculator : calculateCashBreakdown, calculateChange, USD_DENOMINATIONS
35
36
  */
36
37
  interface PxConvertResult {
37
38
  px: number;
@@ -765,6 +766,47 @@ interface CompareUnitPricesResult {
765
766
  declare function compareUnitPrices(items: UnitPriceItem[]): CompareUnitPricesResult | {
766
767
  error: string;
767
768
  };
769
+ interface CashDenominationItem {
770
+ denomination: number;
771
+ count: number;
772
+ subtotal: number;
773
+ }
774
+ interface CashBreakdownResult {
775
+ amount: number;
776
+ denominations: number[];
777
+ breakdown: CashDenominationItem[];
778
+ totalCount: number;
779
+ remainder: number;
780
+ }
781
+ interface CashChangeResult {
782
+ amountDue: number;
783
+ amountTendered: number;
784
+ changeDue: number;
785
+ denominations: number[];
786
+ breakdown: CashDenominationItem[];
787
+ totalCount: number;
788
+ remainder: number;
789
+ }
790
+ /** US bill and coin denominations, largest first. */
791
+ declare const USD_DENOMINATIONS: number[];
792
+ /**
793
+ * Break a cash amount down into the minimum count of bills/coins from a
794
+ * given set of denominations, using the standard greedy largest-first
795
+ * approach (optimal for canonical currency denomination sets like USD,
796
+ * EUR, and GBP). Any amount that can't be represented exactly with the
797
+ * given denominations is reported as `remainder` rather than rounded away.
798
+ */
799
+ declare function calculateCashBreakdown(amount: number, denominations: number[]): CashBreakdownResult | {
800
+ error: string;
801
+ };
802
+ /**
803
+ * Compute the change owed for a payment/tender pair (amount tendered minus
804
+ * amount due) and break that change down into the minimum count of
805
+ * bills/coins from the given denominations.
806
+ */
807
+ declare function calculateChange(amountDue: number, amountTendered: number, denominations: number[]): CashChangeResult | {
808
+ error: string;
809
+ };
768
810
 
769
811
  type units_AmortizationRow = AmortizationRow;
770
812
  type units_AprApyDirection = AprApyDirection;
@@ -789,6 +831,9 @@ declare const units_COMMON_TAX_RATES: typeof COMMON_TAX_RATES;
789
831
  declare const units_COMMON_TIP_PERCENTAGES: typeof COMMON_TIP_PERCENTAGES;
790
832
  declare const units_COMMON_VIEWPORTS: typeof COMMON_VIEWPORTS;
791
833
  type units_CardValidationResult = CardValidationResult;
834
+ type units_CashBreakdownResult = CashBreakdownResult;
835
+ type units_CashChangeResult = CashChangeResult;
836
+ type units_CashDenominationItem = CashDenominationItem;
792
837
  type units_CompareUnitPricesResult = CompareUnitPricesResult;
793
838
  type units_CompoundInterestResult = CompoundInterestResult;
794
839
  type units_CompoundYearRow = CompoundYearRow;
@@ -832,6 +877,7 @@ type units_TaxResult = TaxResult;
832
877
  type units_TimeValueDirection = TimeValueDirection;
833
878
  type units_TimeValueResult = TimeValueResult;
834
879
  type units_TipSplitResult = TipSplitResult;
880
+ declare const units_USD_DENOMINATIONS: typeof USD_DENOMINATIONS;
835
881
  type units_UnitPriceItem = UnitPriceItem;
836
882
  type units_UnitPriceResult = UnitPriceResult;
837
883
  type units_VideoBitrateInput = VideoBitrateInput;
@@ -844,6 +890,8 @@ declare const units_bumpVersion: typeof bumpVersion;
844
890
  declare const units_calcAspectRatio: typeof calcAspectRatio;
845
891
  declare const units_calcSubnet: typeof calcSubnet;
846
892
  declare const units_calculateBreakEven: typeof calculateBreakEven;
893
+ declare const units_calculateCashBreakdown: typeof calculateCashBreakdown;
894
+ declare const units_calculateChange: typeof calculateChange;
847
895
  declare const units_calculateCompoundInterest: typeof calculateCompoundInterest;
848
896
  declare const units_calculateDiscount: typeof calculateDiscount;
849
897
  declare const units_calculateEmi: typeof calculateEmi;
@@ -912,7 +960,7 @@ declare const units_validateIban: typeof validateIban;
912
960
  declare const units_validateIsbn: typeof validateIsbn;
913
961
  declare const units_viewportToPx: typeof viewportToPx;
914
962
  declare namespace units {
915
- export { type units_AmortizationRow as AmortizationRow, type units_AprApyDirection as AprApyDirection, type units_AprApyResult as AprApyResult, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_BreakEvenInput as BreakEvenInput, type units_BreakEvenResult as BreakEvenResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_TIP_PERCENTAGES as COMMON_TIP_PERCENTAGES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CompareUnitPricesResult as CompareUnitPricesResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, type units_EmiResult as EmiResult, type units_EmiTenureUnit as EmiTenureUnit, type units_EmiYearlyBreakdownRow as EmiYearlyBreakdownRow, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RoiInput as RoiInput, type units_RoiResult as RoiResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, type units_SavingsGoalInput as SavingsGoalInput, type units_SavingsGoalMode as SavingsGoalMode, type units_SavingsGoalResult as SavingsGoalResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_SuccessiveDiscountResult as SuccessiveDiscountResult, type units_SuccessiveDiscountStep as SuccessiveDiscountStep, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, type units_UnitPriceItem as UnitPriceItem, type units_UnitPriceResult as UnitPriceResult, type units_VideoBitrateInput as VideoBitrateInput, type units_VideoBitrateMode as VideoBitrateMode, type units_VideoBitrateResult as VideoBitrateResult, type units_ViewportConvertResult as ViewportConvertResult, units_applySuccessiveDiscounts as applySuccessiveDiscounts, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateBreakEven as calculateBreakEven, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateDiscount as calculateDiscount, units_calculateEmi as calculateEmi, units_calculateLoan as calculateLoan, units_calculateMarginMarkup as calculateMarginMarkup, units_calculatePercentageChange as calculatePercentageChange, units_calculateRoi as calculateRoi, units_calculateRuleOf72 as calculateRuleOf72, units_calculateSavingsGoal as calculateSavingsGoal, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_calculateVideoBitrate as calculateVideoBitrate, units_compareSemver as compareSemver, units_compareUnitPrices as compareUnitPrices, units_convert as convert, units_convertAprApy as convertAprApy, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_marginToMarkup as marginToMarkup, units_markupToMargin as markupToMargin, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
963
+ export { type units_AmortizationRow as AmortizationRow, type units_AprApyDirection as AprApyDirection, type units_AprApyResult as AprApyResult, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_BreakEvenInput as BreakEvenInput, type units_BreakEvenResult as BreakEvenResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_TIP_PERCENTAGES as COMMON_TIP_PERCENTAGES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CashBreakdownResult as CashBreakdownResult, type units_CashChangeResult as CashChangeResult, type units_CashDenominationItem as CashDenominationItem, type units_CompareUnitPricesResult as CompareUnitPricesResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, type units_EmiResult as EmiResult, type units_EmiTenureUnit as EmiTenureUnit, type units_EmiYearlyBreakdownRow as EmiYearlyBreakdownRow, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RoiInput as RoiInput, type units_RoiResult as RoiResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, type units_SavingsGoalInput as SavingsGoalInput, type units_SavingsGoalMode as SavingsGoalMode, type units_SavingsGoalResult as SavingsGoalResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_SuccessiveDiscountResult as SuccessiveDiscountResult, type units_SuccessiveDiscountStep as SuccessiveDiscountStep, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, units_USD_DENOMINATIONS as USD_DENOMINATIONS, type units_UnitPriceItem as UnitPriceItem, type units_UnitPriceResult as UnitPriceResult, type units_VideoBitrateInput as VideoBitrateInput, type units_VideoBitrateMode as VideoBitrateMode, type units_VideoBitrateResult as VideoBitrateResult, type units_ViewportConvertResult as ViewportConvertResult, units_applySuccessiveDiscounts as applySuccessiveDiscounts, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateBreakEven as calculateBreakEven, units_calculateCashBreakdown as calculateCashBreakdown, units_calculateChange as calculateChange, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateDiscount as calculateDiscount, units_calculateEmi as calculateEmi, units_calculateLoan as calculateLoan, units_calculateMarginMarkup as calculateMarginMarkup, units_calculatePercentageChange as calculatePercentageChange, units_calculateRoi as calculateRoi, units_calculateRuleOf72 as calculateRuleOf72, units_calculateSavingsGoal as calculateSavingsGoal, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_calculateVideoBitrate as calculateVideoBitrate, units_compareSemver as compareSemver, units_compareUnitPrices as compareUnitPrices, units_convert as convert, units_convertAprApy as convertAprApy, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_marginToMarkup as marginToMarkup, units_markupToMargin as markupToMargin, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
916
964
  }
917
965
 
918
- export { type RuleOf72Result as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, type DiscountResult as E, type EmiResult as F, type EmiTenureUnit as G, type EmiYearlyBreakdownRow as H, type FilePermissions as I, type FormatOptions as J, type IbanValidationResult as K, type IpConversion as L, type IsbnFormat as M, type IsbnResult as N, type LoanResult as O, type MarginMarkupField as P, type MarginMarkupInput as Q, type MarginMarkupResult as R, type NotationStyle as S, type NumberBase as T, type PercentChangeDirection as U, type PercentageChangeResult as V, type Permission as W, type PxConvertResult as X, type RoiInput as Y, type RoiResult as Z, type RuleOf72Direction as _, type AprApyDirection as a, isValid as a$, type SavingsGoalInput as a0, type SavingsGoalMode as a1, type SavingsGoalResult as a2, type SemverVersion as a3, type SimpleInterestResult as a4, type SubnetInfo as a5, type SuccessiveDiscountResult as a6, type SuccessiveDiscountStep as a7, type TaxDirection as a8, type TaxResult as a9, calculateTimeValue as aA, calculateTipSplit as aB, calculateVideoBitrate as aC, compareSemver as aD, compareUnitPrices as aE, convert as aF, convertAprApy as aG, convertBytes as aH, convertIp as aI, coverBox as aJ, decimalToIp as aK, decimalToIpCidr as aL, describePermissions as aM, fitIntoBox as aN, formatNumber as aO, formatValue as aP, formatVwValue as aQ, formatWithSeparator as aR, gcd as aS, ipFromBinary as aT, ipFromDecimal as aU, ipFromHex as aV, ipToBinary as aW, ipToDecimal as aX, ipToDecimalCidr as aY, ipToHex as aZ, ipToOctal as a_, type TimeValueDirection as aa, type TimeValueResult as ab, type TipSplitResult as ac, type UnitPriceItem as ad, type UnitPriceResult as ae, type VideoBitrateInput as af, type VideoBitrateMode as ag, type VideoBitrateResult as ah, type ViewportConvertResult as ai, applySuccessiveDiscounts as aj, autoFormat as ak, bumpVersion as al, calcAspectRatio as am, calcSubnet as an, calculateBreakEven as ao, calculateCompoundInterest as ap, calculateDiscount as aq, calculateEmi as ar, calculateLoan as as, calculateMarginMarkup as at, calculatePercentageChange as au, calculateRoi as av, calculateRuleOf72 as aw, calculateSavingsGoal as ax, calculateSimpleInterest as ay, calculateTax as az, type AprApyResult as b, isValidCidr as b0, isValidIp as b1, isValidIpv4 as b2, marginToMarkup as b3, markupToMargin as b4, octalToPermissions as b5, parseFileSize as b6, parseInput as b7, parseNumberString as b8, parseSemver as b9, permissionsToChmod as ba, permissionsToOctal as bb, permissionsToSymbolic as bc, ptToPx as bd, pxToAll as be, pxToViewport as bf, remToPx as bg, satisfiesRange as bh, scaleByHeight as bi, scaleByWidth as bj, sortVersions as bk, splitSubnet as bl, symbolicToPermissions as bm, validateBarcode as bn, validateCardNumber as bo, validateIban as bp, validateIsbn as bq, viewportToPx as br, type AspectRatioResult as c, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type BreakEvenInput as i, type BreakEvenResult as j, type ByteConvertResult as k, type ByteUnit as l, COMMON_LOCALES as m, COMMON_PERMISSIONS as n, COMMON_RATIOS as o, COMMON_SIZES as p, COMMON_TAX_RATES as q, COMMON_TIP_PERCENTAGES as r, COMMON_VIEWPORTS as s, type CardValidationResult as t, units as u, type CompareUnitPricesResult as v, type CompoundInterestResult as w, type CompoundYearRow as x, type DiscountField as y, type DiscountInput as z };
966
+ export { type RoiInput as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type CompoundYearRow as D, type Dimensions as E, type DiscountField as F, type DiscountInput as G, type DiscountResult as H, type EmiResult as I, type EmiTenureUnit as J, type EmiYearlyBreakdownRow as K, type FilePermissions as L, type FormatOptions as M, type IbanValidationResult as N, type IpConversion as O, type IsbnFormat as P, type IsbnResult as Q, type LoanResult as R, type MarginMarkupField as S, type MarginMarkupInput as T, type MarginMarkupResult as U, type NotationStyle as V, type NumberBase as W, type PercentChangeDirection as X, type PercentageChangeResult as Y, type Permission as Z, type PxConvertResult as _, type AprApyDirection as a, ipFromHex as a$, type RoiResult as a0, type RuleOf72Direction as a1, type RuleOf72Result as a2, type SavingsGoalInput as a3, type SavingsGoalMode as a4, type SavingsGoalResult as a5, type SemverVersion as a6, type SimpleInterestResult as a7, type SubnetInfo as a8, type SuccessiveDiscountResult as a9, calculatePercentageChange as aA, calculateRoi as aB, calculateRuleOf72 as aC, calculateSavingsGoal as aD, calculateSimpleInterest as aE, calculateTax as aF, calculateTimeValue as aG, calculateTipSplit as aH, calculateVideoBitrate as aI, compareSemver as aJ, compareUnitPrices as aK, convert as aL, convertAprApy as aM, convertBytes as aN, convertIp as aO, coverBox as aP, decimalToIp as aQ, decimalToIpCidr as aR, describePermissions as aS, fitIntoBox as aT, formatNumber as aU, formatValue as aV, formatVwValue as aW, formatWithSeparator as aX, gcd as aY, ipFromBinary as aZ, ipFromDecimal as a_, type SuccessiveDiscountStep as aa, type TaxDirection as ab, type TaxResult as ac, type TimeValueDirection as ad, type TimeValueResult as ae, type TipSplitResult as af, USD_DENOMINATIONS as ag, type UnitPriceItem as ah, type UnitPriceResult as ai, type VideoBitrateInput as aj, type VideoBitrateMode as ak, type VideoBitrateResult as al, type ViewportConvertResult as am, applySuccessiveDiscounts as an, autoFormat as ao, bumpVersion as ap, calcAspectRatio as aq, calcSubnet as ar, calculateBreakEven as as, calculateCashBreakdown as at, calculateChange as au, calculateCompoundInterest as av, calculateDiscount as aw, calculateEmi as ax, calculateLoan as ay, calculateMarginMarkup as az, type AprApyResult as b, ipToBinary as b0, ipToDecimal as b1, ipToDecimalCidr as b2, ipToHex as b3, ipToOctal as b4, isValid as b5, isValidCidr as b6, isValidIp as b7, isValidIpv4 as b8, marginToMarkup as b9, markupToMargin as ba, octalToPermissions as bb, parseFileSize as bc, parseInput as bd, parseNumberString as be, parseSemver as bf, permissionsToChmod as bg, permissionsToOctal as bh, permissionsToSymbolic as bi, ptToPx as bj, pxToAll as bk, pxToViewport as bl, remToPx as bm, satisfiesRange as bn, scaleByHeight as bo, scaleByWidth as bp, sortVersions as bq, splitSubnet as br, symbolicToPermissions as bs, validateBarcode as bt, validateCardNumber as bu, validateIban as bv, validateIsbn as bw, viewportToPx as bx, type AspectRatioResult as c, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type BreakEvenInput as i, type BreakEvenResult as j, type ByteConvertResult as k, type ByteUnit as l, COMMON_LOCALES as m, COMMON_PERMISSIONS as n, COMMON_RATIOS as o, COMMON_SIZES as p, COMMON_TAX_RATES as q, COMMON_TIP_PERCENTAGES as r, COMMON_VIEWPORTS as s, type CardValidationResult as t, units as u, type CashBreakdownResult as v, type CashChangeResult as w, type CashDenominationItem as x, type CompareUnitPricesResult as y, type CompoundInterestResult as z };
@@ -32,6 +32,7 @@
32
32
  * - savings-goal-calculator : calculateSavingsGoal
33
33
  * - roi-calculator : calculateRoi
34
34
  * - unit-price-comparator : compareUnitPrices
35
+ * - cash-till-calculator : calculateCashBreakdown, calculateChange, USD_DENOMINATIONS
35
36
  */
36
37
  interface PxConvertResult {
37
38
  px: number;
@@ -765,6 +766,47 @@ interface CompareUnitPricesResult {
765
766
  declare function compareUnitPrices(items: UnitPriceItem[]): CompareUnitPricesResult | {
766
767
  error: string;
767
768
  };
769
+ interface CashDenominationItem {
770
+ denomination: number;
771
+ count: number;
772
+ subtotal: number;
773
+ }
774
+ interface CashBreakdownResult {
775
+ amount: number;
776
+ denominations: number[];
777
+ breakdown: CashDenominationItem[];
778
+ totalCount: number;
779
+ remainder: number;
780
+ }
781
+ interface CashChangeResult {
782
+ amountDue: number;
783
+ amountTendered: number;
784
+ changeDue: number;
785
+ denominations: number[];
786
+ breakdown: CashDenominationItem[];
787
+ totalCount: number;
788
+ remainder: number;
789
+ }
790
+ /** US bill and coin denominations, largest first. */
791
+ declare const USD_DENOMINATIONS: number[];
792
+ /**
793
+ * Break a cash amount down into the minimum count of bills/coins from a
794
+ * given set of denominations, using the standard greedy largest-first
795
+ * approach (optimal for canonical currency denomination sets like USD,
796
+ * EUR, and GBP). Any amount that can't be represented exactly with the
797
+ * given denominations is reported as `remainder` rather than rounded away.
798
+ */
799
+ declare function calculateCashBreakdown(amount: number, denominations: number[]): CashBreakdownResult | {
800
+ error: string;
801
+ };
802
+ /**
803
+ * Compute the change owed for a payment/tender pair (amount tendered minus
804
+ * amount due) and break that change down into the minimum count of
805
+ * bills/coins from the given denominations.
806
+ */
807
+ declare function calculateChange(amountDue: number, amountTendered: number, denominations: number[]): CashChangeResult | {
808
+ error: string;
809
+ };
768
810
 
769
811
  type units_AmortizationRow = AmortizationRow;
770
812
  type units_AprApyDirection = AprApyDirection;
@@ -789,6 +831,9 @@ declare const units_COMMON_TAX_RATES: typeof COMMON_TAX_RATES;
789
831
  declare const units_COMMON_TIP_PERCENTAGES: typeof COMMON_TIP_PERCENTAGES;
790
832
  declare const units_COMMON_VIEWPORTS: typeof COMMON_VIEWPORTS;
791
833
  type units_CardValidationResult = CardValidationResult;
834
+ type units_CashBreakdownResult = CashBreakdownResult;
835
+ type units_CashChangeResult = CashChangeResult;
836
+ type units_CashDenominationItem = CashDenominationItem;
792
837
  type units_CompareUnitPricesResult = CompareUnitPricesResult;
793
838
  type units_CompoundInterestResult = CompoundInterestResult;
794
839
  type units_CompoundYearRow = CompoundYearRow;
@@ -832,6 +877,7 @@ type units_TaxResult = TaxResult;
832
877
  type units_TimeValueDirection = TimeValueDirection;
833
878
  type units_TimeValueResult = TimeValueResult;
834
879
  type units_TipSplitResult = TipSplitResult;
880
+ declare const units_USD_DENOMINATIONS: typeof USD_DENOMINATIONS;
835
881
  type units_UnitPriceItem = UnitPriceItem;
836
882
  type units_UnitPriceResult = UnitPriceResult;
837
883
  type units_VideoBitrateInput = VideoBitrateInput;
@@ -844,6 +890,8 @@ declare const units_bumpVersion: typeof bumpVersion;
844
890
  declare const units_calcAspectRatio: typeof calcAspectRatio;
845
891
  declare const units_calcSubnet: typeof calcSubnet;
846
892
  declare const units_calculateBreakEven: typeof calculateBreakEven;
893
+ declare const units_calculateCashBreakdown: typeof calculateCashBreakdown;
894
+ declare const units_calculateChange: typeof calculateChange;
847
895
  declare const units_calculateCompoundInterest: typeof calculateCompoundInterest;
848
896
  declare const units_calculateDiscount: typeof calculateDiscount;
849
897
  declare const units_calculateEmi: typeof calculateEmi;
@@ -912,7 +960,7 @@ declare const units_validateIban: typeof validateIban;
912
960
  declare const units_validateIsbn: typeof validateIsbn;
913
961
  declare const units_viewportToPx: typeof viewportToPx;
914
962
  declare namespace units {
915
- export { type units_AmortizationRow as AmortizationRow, type units_AprApyDirection as AprApyDirection, type units_AprApyResult as AprApyResult, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_BreakEvenInput as BreakEvenInput, type units_BreakEvenResult as BreakEvenResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_TIP_PERCENTAGES as COMMON_TIP_PERCENTAGES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CompareUnitPricesResult as CompareUnitPricesResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, type units_EmiResult as EmiResult, type units_EmiTenureUnit as EmiTenureUnit, type units_EmiYearlyBreakdownRow as EmiYearlyBreakdownRow, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RoiInput as RoiInput, type units_RoiResult as RoiResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, type units_SavingsGoalInput as SavingsGoalInput, type units_SavingsGoalMode as SavingsGoalMode, type units_SavingsGoalResult as SavingsGoalResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_SuccessiveDiscountResult as SuccessiveDiscountResult, type units_SuccessiveDiscountStep as SuccessiveDiscountStep, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, type units_UnitPriceItem as UnitPriceItem, type units_UnitPriceResult as UnitPriceResult, type units_VideoBitrateInput as VideoBitrateInput, type units_VideoBitrateMode as VideoBitrateMode, type units_VideoBitrateResult as VideoBitrateResult, type units_ViewportConvertResult as ViewportConvertResult, units_applySuccessiveDiscounts as applySuccessiveDiscounts, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateBreakEven as calculateBreakEven, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateDiscount as calculateDiscount, units_calculateEmi as calculateEmi, units_calculateLoan as calculateLoan, units_calculateMarginMarkup as calculateMarginMarkup, units_calculatePercentageChange as calculatePercentageChange, units_calculateRoi as calculateRoi, units_calculateRuleOf72 as calculateRuleOf72, units_calculateSavingsGoal as calculateSavingsGoal, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_calculateVideoBitrate as calculateVideoBitrate, units_compareSemver as compareSemver, units_compareUnitPrices as compareUnitPrices, units_convert as convert, units_convertAprApy as convertAprApy, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_marginToMarkup as marginToMarkup, units_markupToMargin as markupToMargin, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
963
+ export { type units_AmortizationRow as AmortizationRow, type units_AprApyDirection as AprApyDirection, type units_AprApyResult as AprApyResult, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_BreakEvenInput as BreakEvenInput, type units_BreakEvenResult as BreakEvenResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_TIP_PERCENTAGES as COMMON_TIP_PERCENTAGES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CashBreakdownResult as CashBreakdownResult, type units_CashChangeResult as CashChangeResult, type units_CashDenominationItem as CashDenominationItem, type units_CompareUnitPricesResult as CompareUnitPricesResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, type units_EmiResult as EmiResult, type units_EmiTenureUnit as EmiTenureUnit, type units_EmiYearlyBreakdownRow as EmiYearlyBreakdownRow, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RoiInput as RoiInput, type units_RoiResult as RoiResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, type units_SavingsGoalInput as SavingsGoalInput, type units_SavingsGoalMode as SavingsGoalMode, type units_SavingsGoalResult as SavingsGoalResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_SuccessiveDiscountResult as SuccessiveDiscountResult, type units_SuccessiveDiscountStep as SuccessiveDiscountStep, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, units_USD_DENOMINATIONS as USD_DENOMINATIONS, type units_UnitPriceItem as UnitPriceItem, type units_UnitPriceResult as UnitPriceResult, type units_VideoBitrateInput as VideoBitrateInput, type units_VideoBitrateMode as VideoBitrateMode, type units_VideoBitrateResult as VideoBitrateResult, type units_ViewportConvertResult as ViewportConvertResult, units_applySuccessiveDiscounts as applySuccessiveDiscounts, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateBreakEven as calculateBreakEven, units_calculateCashBreakdown as calculateCashBreakdown, units_calculateChange as calculateChange, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateDiscount as calculateDiscount, units_calculateEmi as calculateEmi, units_calculateLoan as calculateLoan, units_calculateMarginMarkup as calculateMarginMarkup, units_calculatePercentageChange as calculatePercentageChange, units_calculateRoi as calculateRoi, units_calculateRuleOf72 as calculateRuleOf72, units_calculateSavingsGoal as calculateSavingsGoal, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_calculateVideoBitrate as calculateVideoBitrate, units_compareSemver as compareSemver, units_compareUnitPrices as compareUnitPrices, units_convert as convert, units_convertAprApy as convertAprApy, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_marginToMarkup as marginToMarkup, units_markupToMargin as markupToMargin, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
916
964
  }
917
965
 
918
- export { type RuleOf72Result as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, type DiscountResult as E, type EmiResult as F, type EmiTenureUnit as G, type EmiYearlyBreakdownRow as H, type FilePermissions as I, type FormatOptions as J, type IbanValidationResult as K, type IpConversion as L, type IsbnFormat as M, type IsbnResult as N, type LoanResult as O, type MarginMarkupField as P, type MarginMarkupInput as Q, type MarginMarkupResult as R, type NotationStyle as S, type NumberBase as T, type PercentChangeDirection as U, type PercentageChangeResult as V, type Permission as W, type PxConvertResult as X, type RoiInput as Y, type RoiResult as Z, type RuleOf72Direction as _, type AprApyDirection as a, isValid as a$, type SavingsGoalInput as a0, type SavingsGoalMode as a1, type SavingsGoalResult as a2, type SemverVersion as a3, type SimpleInterestResult as a4, type SubnetInfo as a5, type SuccessiveDiscountResult as a6, type SuccessiveDiscountStep as a7, type TaxDirection as a8, type TaxResult as a9, calculateTimeValue as aA, calculateTipSplit as aB, calculateVideoBitrate as aC, compareSemver as aD, compareUnitPrices as aE, convert as aF, convertAprApy as aG, convertBytes as aH, convertIp as aI, coverBox as aJ, decimalToIp as aK, decimalToIpCidr as aL, describePermissions as aM, fitIntoBox as aN, formatNumber as aO, formatValue as aP, formatVwValue as aQ, formatWithSeparator as aR, gcd as aS, ipFromBinary as aT, ipFromDecimal as aU, ipFromHex as aV, ipToBinary as aW, ipToDecimal as aX, ipToDecimalCidr as aY, ipToHex as aZ, ipToOctal as a_, type TimeValueDirection as aa, type TimeValueResult as ab, type TipSplitResult as ac, type UnitPriceItem as ad, type UnitPriceResult as ae, type VideoBitrateInput as af, type VideoBitrateMode as ag, type VideoBitrateResult as ah, type ViewportConvertResult as ai, applySuccessiveDiscounts as aj, autoFormat as ak, bumpVersion as al, calcAspectRatio as am, calcSubnet as an, calculateBreakEven as ao, calculateCompoundInterest as ap, calculateDiscount as aq, calculateEmi as ar, calculateLoan as as, calculateMarginMarkup as at, calculatePercentageChange as au, calculateRoi as av, calculateRuleOf72 as aw, calculateSavingsGoal as ax, calculateSimpleInterest as ay, calculateTax as az, type AprApyResult as b, isValidCidr as b0, isValidIp as b1, isValidIpv4 as b2, marginToMarkup as b3, markupToMargin as b4, octalToPermissions as b5, parseFileSize as b6, parseInput as b7, parseNumberString as b8, parseSemver as b9, permissionsToChmod as ba, permissionsToOctal as bb, permissionsToSymbolic as bc, ptToPx as bd, pxToAll as be, pxToViewport as bf, remToPx as bg, satisfiesRange as bh, scaleByHeight as bi, scaleByWidth as bj, sortVersions as bk, splitSubnet as bl, symbolicToPermissions as bm, validateBarcode as bn, validateCardNumber as bo, validateIban as bp, validateIsbn as bq, viewportToPx as br, type AspectRatioResult as c, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type BreakEvenInput as i, type BreakEvenResult as j, type ByteConvertResult as k, type ByteUnit as l, COMMON_LOCALES as m, COMMON_PERMISSIONS as n, COMMON_RATIOS as o, COMMON_SIZES as p, COMMON_TAX_RATES as q, COMMON_TIP_PERCENTAGES as r, COMMON_VIEWPORTS as s, type CardValidationResult as t, units as u, type CompareUnitPricesResult as v, type CompoundInterestResult as w, type CompoundYearRow as x, type DiscountField as y, type DiscountInput as z };
966
+ export { type RoiInput as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type CompoundYearRow as D, type Dimensions as E, type DiscountField as F, type DiscountInput as G, type DiscountResult as H, type EmiResult as I, type EmiTenureUnit as J, type EmiYearlyBreakdownRow as K, type FilePermissions as L, type FormatOptions as M, type IbanValidationResult as N, type IpConversion as O, type IsbnFormat as P, type IsbnResult as Q, type LoanResult as R, type MarginMarkupField as S, type MarginMarkupInput as T, type MarginMarkupResult as U, type NotationStyle as V, type NumberBase as W, type PercentChangeDirection as X, type PercentageChangeResult as Y, type Permission as Z, type PxConvertResult as _, type AprApyDirection as a, ipFromHex as a$, type RoiResult as a0, type RuleOf72Direction as a1, type RuleOf72Result as a2, type SavingsGoalInput as a3, type SavingsGoalMode as a4, type SavingsGoalResult as a5, type SemverVersion as a6, type SimpleInterestResult as a7, type SubnetInfo as a8, type SuccessiveDiscountResult as a9, calculatePercentageChange as aA, calculateRoi as aB, calculateRuleOf72 as aC, calculateSavingsGoal as aD, calculateSimpleInterest as aE, calculateTax as aF, calculateTimeValue as aG, calculateTipSplit as aH, calculateVideoBitrate as aI, compareSemver as aJ, compareUnitPrices as aK, convert as aL, convertAprApy as aM, convertBytes as aN, convertIp as aO, coverBox as aP, decimalToIp as aQ, decimalToIpCidr as aR, describePermissions as aS, fitIntoBox as aT, formatNumber as aU, formatValue as aV, formatVwValue as aW, formatWithSeparator as aX, gcd as aY, ipFromBinary as aZ, ipFromDecimal as a_, type SuccessiveDiscountStep as aa, type TaxDirection as ab, type TaxResult as ac, type TimeValueDirection as ad, type TimeValueResult as ae, type TipSplitResult as af, USD_DENOMINATIONS as ag, type UnitPriceItem as ah, type UnitPriceResult as ai, type VideoBitrateInput as aj, type VideoBitrateMode as ak, type VideoBitrateResult as al, type ViewportConvertResult as am, applySuccessiveDiscounts as an, autoFormat as ao, bumpVersion as ap, calcAspectRatio as aq, calcSubnet as ar, calculateBreakEven as as, calculateCashBreakdown as at, calculateChange as au, calculateCompoundInterest as av, calculateDiscount as aw, calculateEmi as ax, calculateLoan as ay, calculateMarginMarkup as az, type AprApyResult as b, ipToBinary as b0, ipToDecimal as b1, ipToDecimalCidr as b2, ipToHex as b3, ipToOctal as b4, isValid as b5, isValidCidr as b6, isValidIp as b7, isValidIpv4 as b8, marginToMarkup as b9, markupToMargin as ba, octalToPermissions as bb, parseFileSize as bc, parseInput as bd, parseNumberString as be, parseSemver as bf, permissionsToChmod as bg, permissionsToOctal as bh, permissionsToSymbolic as bi, ptToPx as bj, pxToAll as bk, pxToViewport as bl, remToPx as bm, satisfiesRange as bn, scaleByHeight as bo, scaleByWidth as bp, sortVersions as bq, splitSubnet as br, symbolicToPermissions as bs, validateBarcode as bt, validateCardNumber as bu, validateIban as bv, validateIsbn as bw, viewportToPx as bx, type AspectRatioResult as c, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type BreakEvenInput as i, type BreakEvenResult as j, type ByteConvertResult as k, type ByteUnit as l, COMMON_LOCALES as m, COMMON_PERMISSIONS as n, COMMON_RATIOS as o, COMMON_SIZES as p, COMMON_TAX_RATES as q, COMMON_TIP_PERCENTAGES as r, COMMON_VIEWPORTS as s, type CardValidationResult as t, units as u, type CashBreakdownResult as v, type CashChangeResult as w, type CashDenominationItem as x, type CompareUnitPricesResult as y, type CompoundInterestResult as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilix-tech/sdk",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "description": "154+ developer utility tools for Node.js: JSON, encoding, hashing, color, CSS, network and more. Runs locally, no API key required.",
5
5
  "author": "Utilix <hello@utilix.tech>",
6
6
  "license": "MIT",