Text Obfuscation - Part I of II


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. using System;
  2.  
  3.  
  4. namespace Kyrathasoft.Obfuscate {
  5.  
  6. [Serializable]
  7. public class serText {
  8.  
  9. //constructor
  10. public serText(string inputText, bool theWorks) {
  11. theText = inputText;
  12. if (!theWorks) {
  13. startIndex = 0;
  14. theLength = inputText.Length;
  15. reverse = false;
  16. shift = false;
  17. }
  18. else {
  19. reverse = true;
  20. shift = true;
  21. }
  22. }
  23.  
  24. //constructor
  25. public serText(string inputText, int start, int length, bool reverse, bool shift) {
  26. theText = inputText;
  27. startIndex = start;
  28. theLength = length;
  29. this.shift = shift;
  30. this.reverse = reverse;
  31. }
  32.  
  33.  
  34. //constructor
  35. public serText(string inputText, int start, int length, bool theWorks) {
  36. theText = inputText;
  37. startIndex = start;
  38. theLength = length;
  39.  
  40. if (theWorks) {
  41. this.shift = true;
  42. this.reverse = true;
  43. }
  44.  
  45. }
  46.  
  47.  
  48.  
  49.  
  50. private string theText;
  51. public string TheText {
  52. get { return theText; }
  53. set { theText = value; }
  54. }
  55.  
  56.  
  57. private int startIndex;
  58. public int StartIndex {
  59. get { return startIndex; }
  60. set { startIndex = value; }
  61. }
  62.  
  63.  
  64. private int theLength;
  65. public int TheLength {
  66. get { return theLength; }
  67. set { theLength = value; }
  68. }
  69.  
  70. private bool reverse;
  71. public bool Reverse {
  72. get { return reverse; }
  73. set { reverse = value; }
  74. }
  75.  
  76. private bool shift;
  77. public bool Shift {
  78. get { return shift; }
  79. set { shift = value; }
  80. }
  81.  
  82.  
  83.  
  84. }
  85. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.