VistA-hash/VWHSHCWN.m

21 lines
661 B
Mathematica
Raw Permalink Normal View History

2010-01-26 22:53:53 -05:00
XUSHSH ;;GpZ; ; IMPROVED HASHING UTILITY: Cache/Windows (VWHSHCWN);01/08/2010
V ;;8.0;KERNEL;;Jul 10, 1995
;;
A S X=$$EN(X) Q
;;
EN(X,HASH) ;;
N (X,HASH)
D:'$L($G(^%ZOSF("HASHLIST"))) DEFHASH^VWHSH0
S HASHLIST=^%ZOSF("HASHLIST")
S HASH=$S('$L($G(HASH)):$P(HASHLIST,"|",1),1:$TR(HASH,"abcdefghijklmnopqrstuvwxyz- ","ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
IF HASH="LEGACY" QUIT $$EN^VWHSHLEG(X)
Q:HASHLIST'[(" "_HASH_" ") X
N PIPE,ZUT,I
S ZUT=$ZUTIL(68,40,1)
S PIPE=" echo "_X_"||"_$P(HASHLIST,"||",3)_"gpg --print-md "_HASH
OPEN PIPE:"Q"
F I=1:1:4 USE PIPE R X Q:$ZEOF<0 S HASHOUT=$G(HASHOUT)_X
CLOSE PIPE
S ZUT=$ZUTIL(68,40,ZUT),X=HASHOUT
Q $TR(X," ")