UNPKG

@axerunners/insight-ui

Version:

An open-source frontend for the Insight API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the Axe network and build your own services with it.

15 lines (13 loc) 391 B
'use strict'; angular.module('insight.hash') .factory('HashValidator', function () { return { test64: function (hashStr) { return typeof hashStr === 'string' && /^(0x)?[0-9a-f]{64}$/i.test(hashStr); }, test66: function (hashStr) { return typeof hashStr === 'string' && /^(0x)?[0-9a-f]{66}$/i.test(hashStr); } }; });