IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

detect-hashes.js 554B

123456789101112131415161718192021222324252627
  1. function detectHashes(obj) {
  2. let Q = [ obj ];
  3. let matches = {};
  4. while (Q.length > 0) {
  5. let item = Q.pop();
  6. if (!item)
  7. continue;
  8. if (typeof(item) === 'string') {
  9. // use regexes
  10. let rx = /[a-f0-9]{32}\+[0-9]+/g;
  11. for (let m = rx.exec(item); m; m = rx.exec(item))
  12. matches[m[0]] = true;
  13. } else if (typeof(item) === 'object') {
  14. Object.keys(item).map(k => Q.push(item[k]));
  15. }
  16. }
  17. matches = Object.keys(matches);
  18. return matches;
  19. }
  20. export default detectHashes;