- JSON Formatter/Viewer
Format, minify, visualize and validate JSON.
- JSON Diff
Compare two JSON objects.
- JSON Schema Validator
Validate JSON schema online
- Base64 Encode/Decode
Encode and decode Base64.
- URL Encode/Decode
Encode and decode URL.
- UUID Generator v4 / v1
Generate UUIDs in v4 and other versions.
- Text Hash
Generate cryptographic hashes from your text input using a wide variety of algorithms.
- File Hash
Generate cryptographic hashes from your file using a wide variety of algorithms.
- JWT Decoder & Validator
Decode and validate JSON Web Tokens.
- CSV Viewer
View CSV data in a table.
- CSV to JSON Converter
Convert CSV to JSON.
- JSON to CSV Converter
Convert JSON to CSV.
Hashtable JavaScript
This snippet displays how to implement and use a hashtable in JavaScript.
function HashTable(obj)
{
this.length = 0;
this.items = {};
for (var p in obj) {
if (obj.hasOwnProperty(p)) {
this.items[p] = obj[p];
this.length++;
}
}
}
This code defines a hashtable in JavaScript using a function. The hashtable is created with the help of the 'items' object.
The 'for' loop iterates through the object passed to the function, checking if the property belongs to the actual object and is not just inherited.
If the property belongs to the object, it's added to the 'items' object and the 'length' property is incremented.