import crypto from "crypto";

// THIS IS ONLY TEMP
const privatekey = `-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDJ9itcSsBa9FNyE1jBn4OBfOYsMSSJWyi0Jgn6qXNvSzLks7INwmkqejrEc4WOdUNjQ6XaoAK/vmBf7oMQJ+xuDl47rYVqLGW0JAKPSbn0QA19bmr3eSIyUeqrhfwRGn4YLBDm6CMu+m8P/VaDU1qSxPd2PuIpLmTlKFMcF+HWEQIDAQABAoGBAL49+x5W89c5q5kbjFHnlpLVOmSKbiZNDoyUAHZ0RF6j8W7prmGzrijrNoxzXW2SHEZXJNZKQAyqolH7dM41LUnaIWizNoIkuJKIb+HWzQlnu75KLNyVDtlMyTNnwTfHkAQ6vmRv8f8S74ZXlj+SKNVjd0p0R+TSqh4NHzNZkNC5AkEA33wCzFtvZJv5cVbc8Ak8VmmSdoPN9HBHuJ1BJ/VTYrd9NmGoxbb2Ixfc3kVItD1NMLs9Jo3x8VKyC0fP90KAIwJBAOdYgtK4QGJHco48J37K3g9r4Kjidv933ADnkZefhTGE4ycakv5gcvnMWbcjHRPv3a7r39+ukgsbNB7BdyKWWjsCQBsewHQuMGFkMCwZ32vdow3Vd+mb6xVbvshfhPWlZr4XCEHeLg34OvxdO/dZLw54VfKw9iXEmfSwFV0bFNiroEMCQQCB05AHBNNM09+bpnJbmykm6lk3LW+uSesyrsFrn1+1vGdlSGp5SlL7kAxA0/m7eH6lbUVDV8opZWjIYbWjuVCFAkEAv8rLnjBwqbNY1O67a4rXh4DJZ7lHm5meX7+YcW5haB4GGyZpikVXYEcfwcM5A03dTKgljLbcDT8diO5RTOsDEg==
-----END RSA PRIVATE KEY-----`;

export default function (input) {
	const sign = crypto.createSign("sha1");
	sign.write(input);
	sign.end();

	const signature = sign.sign(privatekey);
	return signature.toString("base64");
}
