Skip to content

Instantly share code, notes, and snippets.

View ahmdrz's full-sized avatar
💭
I may be slow to respond.

Ahmadreza Zibaei ahmdrz

💭
I may be slow to respond.
View GitHub Profile
package main
import (
"crypto/hmac"
"crypto/sha256"
"fmt"
)
func CheckMAC(message, messageMAC, key []byte) bool {
mac := hmac.New(sha256.New, key)
func CallMethod(i interface{}, methodName string) interface{} {
var ptr reflect.Value
var value reflect.Value
var finalMethod reflect.Value
value = reflect.ValueOf(i)
if value.Type().Kind() == reflect.Ptr {
ptr = value
@ahmdrz
ahmdrz / rial.js
Last active September 7, 2016 06:34
add comma in price numbers
function addCommaByID(id) {
var price;
price = "";
var field = document.getElementById(id);
while (field.value.indexOf(',') != -1) {
field.value = field.value.replace(',', '');
}
txt_field = field.value.length;