Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Anon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import policy from './DefaultPolicy';
import sjcl from './sjcl.sha512'
import sjcl from './sjcl.sha512';
// Prefix from Medical Connections
const UIDPREFIX = "1.2.826.0.1.3680043.10.341.";
// We want to keep the hash algorithm the same to preserve references.
Expand Down Expand Up @@ -34,6 +34,7 @@ export default function anonymize(dict) {
for(const key of Object.keys(dict)) {
// Use default action or action specified in policy
var rule = policy["default"];
//what happens if key is not in policy? ???
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rule is initially set to the default policy (the preceding line).

If there's a policy for that specific key, we use that instead.

if (key in policy) { rule = policy[key]; }
var action = rule["action"];
// For keep actions we can just pass the tag accross...
Expand Down