framework/st_things : url safe base64 encoding for artik h/w certificate uuid
problem : (cci1+6o5 -> cci1%2B6o5)
solution : Base64 Encode -> Base64 URL Safe Encode
@@ -306,5 +306,15 @@ bool things_encrypt_artik_uuid(unsigned char *output)
memcpy(output, encode_buf2, 8);
THINGS_LOG_D(THINGS_DEBUG, TAG, "output len [%d][%s]", strlen((char *)output), output);
+ // 6. url safe
+ int i;
+ for (i = 0; i < 8; i++) {
+ if (output[i] == '+')
+ output[i] = '-';
+ else if (output[i] == '/')
+ output[i] = '_';
+ }
+ THINGS_LOG_D(THINGS_DEBUG, TAG, "urlsafe output len [%d][%s]", strlen((char *)output), output);
+
return true;
}
\ No newline at end of file
