UNPKG
traceprompt-node
Version:
latest (2.0.1)
2.0.1
2.0.0
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
Client-side encrypted, audit-ready logging for LLM applications
traceprompt-node
/
src
/
piiDetector
/
utils
/
aba.ts
10 lines
(9 loc)
•
247 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
export
function
abaValid(routing: string): boolean {
if
(!/^\d{9}$/.test(routing))
return
false
; const weights = [3, 7, 1];
let
sum
= 0;
for
(
let
i = 0; i < 9; i++) {
sum
+= +routing[i] * weights[i % 3]; }
return
sum
% 10 === 0; }