Advertisement
Kappapastes

Untitled

Mar 6th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. var Encryption = function(key, options) {
  2. try {
  3. sjcl.random.startCollectors()
  4. } catch (e) {}
  5. try {
  6. df()
  7. } catch (e) {}
  8. this.key = key;
  9. this.options = options || {};
  10. if (typeof this.options.numberIgnoreNonNumeric === "undefined") {
  11. this.options.numberIgnoreNonNumeric = true
  12. }
  13. if (typeof this.options.cvcIgnoreFornumber !== "undefined") {
  14. delete this.options.cvcIgnoreFornumber
  15. }
  16. if (typeof this.options.fourDigitCvcForBins === "undefined") {
  17. this.options.fourDigitCvcForBins = "34,37"
  18. }
  19. if (typeof this.options.cvcLengthFornumber !== "undefined") {
  20. delete this.options.cvcLengthFornumber
  21. }
  22. if (typeof this.options.cvcIgnoreBins === "string") {
  23. var binsToIgnore = [];
  24. this.options.cvcIgnoreBins.replace(/\d+/g, function(m) {
  25. if (m.length > 0 && !isNaN(parseInt(m, 10))) {
  26. binsToIgnore.push(m)
  27. }
  28. return m
  29. });
  30. if (binsToIgnore.length > 0) {
  31. this.options.cvcIgnoreFornumber = new RegExp("^\\s*(" + binsToIgnore.join("|") + ")")
  32. }
  33. } else {
  34. if (typeof this.options.cvcIgnoreBins !== "undefined") {
  35. delete this.options.cvcIgnoreBins
  36. }
  37. }
  38. if (typeof this.options.fourDigitCvcForBins === "string") {
  39. var cvcGroups = [];
  40. this.options.fourDigitCvcForBins.replace(/\d+/g, function(m) {
  41. if (m.length > 0 && !isNaN(parseInt(m, 10))) {
  42. cvcGroups.push(m)
  43. }
  44. return m
  45. });
  46. if (cvcGroups.length > 0) {
  47. this.options.cvcLengthFornumber = {
  48. matcher: new RegExp("^\\s*(" + cvcGroups.join("|") + ")"),
  49. requiredLength: 4
  50. }
  51. }
  52. }
  53. delete this.options.fourDigitCvcForBins;
  54. evLog("initializeCount")
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement