+ printf("Hash: %s\n", (u8 *)hash);
+
+// for (i = out_len; i < 32; i++) {
+// ((u8 *)hash)[i] = 0;
+// }
+
+ startingsize = size - 4;
+ startingsize = (startingsize < extrasize) ? startingsize : extrasize;
+
+ for (i = 0; i < startingsize; i++) {
+ ((u8 *)data)[i] = ((u8 *)hash)[i];
+ }
+ for (i = startingsize; i < 32; i++) {
+ ((u8 *)data)[i] = 0;
+ }
+
+ extrapos = startingsize;
+
+ // Add the extras
+ // Capital letter
+ next = (extrapos < extrasize) ? ((u8 *)hash)[extrapos] : 0;
+ extrapos++;
+ if (!contains((u8 *)data, startingsize, 'A', 'Z')) {
+ next = 'A' + (next % ('Z' - 'A' + 1));
+ }
+ ((u8 *)data)[startingsize] = next;
+ startingsize++;
+
+ // Lower case letter
+ next = (extrapos < extrasize) ? ((u8 *)hash)[extrapos] : 0;
+ extrapos++;
+ if (!contains((u8 *)data, startingsize, 'a', 'z')) {
+ next = 'a' + (next % ('z' - 'a' + 1));
+ }
+ ((u8 *)data)[startingsize] = next;
+ startingsize++;
+
+ // Number
+ next = (extrapos < extrasize) ? ((u8 *)hash)[extrapos] : 0;
+ extrapos++;
+ if (!contains((u8 *)data, startingsize, '0', '9')) {
+ next = '0' + (next % ('9' - '0' + 1));
+ }
+ ((u8 *)data)[startingsize] = next;
+ startingsize++;
+
+ // Non alphanumeric
+ if (containsnonalphanumeric((u8 *)data, startingsize) && nonalphanumeric) {
+ next = (extrapos < extrasize) ? ((u8 *)hash)[extrapos] : 0;
+ extrapos++;
+ }
+ else {
+ next = '+';
+ }
+ ((u8 *)data)[startingsize] = next;
+ startingsize++;
+
+ if (!nonalphanumeric) {
+ for (i = 0; i < startingsize; i++) {
+ if (containsnonalphanumeric(((u8 *)data) + i, 1)) {
+ next = (extrapos < extrasize) ? ((u8 *)hash)[extrapos] : 0;
+ extrapos++;
+ next = 'A' + (next % ('Z' - 'A' + 1));
+ ((u8 *)data)[i] = next;
+ }
+ }
+ }
+
+ next = (extrapos < extrasize) ? ((u8 *)hash)[extrapos] : 0;
+ rotate_string((u8 *)data, startingsize, next);
+ ((u8 *)data)[startingsize] = 0;
+
+ out_len = startingsize;
+