JSRUN 用代码说话
鸡彼特
lohiecan
JSRUN的第18位用户
加入于 2016-04-18
上次活跃 2020-09-23



就是这么秀
// var b = new Buffer('JavaScript');
// var s = b.toString('base64');
// SmF2YVNjcmlwdA==


var b = new Buffer('SmF2YVNjcmlwdA==', 'base64')
var s = b.toString();
console.log(s);
lohiecan (鸡彼特 )- 2020-09-04 0 人
BASE64加解密
var crypto = require('crypto');
var content = '123456';
var result = crypto.createHash('md5').update(content).digest("hex")
console.log(result);  //e10adc3949ba59abbe56e057f20f883e
lohiecan (鸡彼特 )- 2020-09-04 0 人
node.js md5运算
<?php 
//JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 



echo md5('131384b38422802866');
 
lohiecan (鸡彼特 )- 2020-09-03 0 人
php md5 运算
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

class MD5Utils {
	public static void main(String[] args) { 
		System.out.println(MD5Utils.md5("Hello JSRUN! - from JAVA ."));
	}

     public static String md5(String plainText) {
        byte[] secretBytes = null;
        try {
            secretBytes = MessageDigest.getInstance("md5").digest(
                    plainText.getBytes());
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException("没有这个md5算法!");
        }
        String md5code = new BigInteger(1, secretBytes).toString(16);
        for (int i = 0; i < 32 - md5code.length(); i++) {
            md5code = "0" + md5code;
        }
        return md5code;
    }

}

 
lohiecan (鸡彼特 )- 2020-09-02 0 人
JAVA的原生MD5方法
let ltcPrice = 59;
let ltc = 100;
let usdt = 1000;
let rate = 0.02;
let payload = 3;
let rmbRate = 6.92;
let exchangeRate = 0.002;


console.log("当前市值:", (ltcPrice * ltc + usdt) * rmbRate,"元");

let profit = payload * ltcPrice * rate * (1 - 2 * exchangeRate)*rmbRate;
console.log("一次买卖操作利润:", profit,"元\n");

let price = ltcPrice;
let usdtLeft = usdt;
let ltcLeft = ltc;
let count = 0;
let cost = 0;
while (usdtLeft >= price * payload) {
    price *= (1 - rate);
    usdtLeft -= price * payload;
    ltcLeft += payload * (1 - exchangeRate);
    count++;
}
console.log("区间下限:", price, " 最少买入次数:", count);
console.log("出下限市值:", (price * ltcLeft + usdtLeft) * rmbRate,"元");
console.log("price:",  price ,"=" ,price* rmbRate,"元\n");

price = ltcPrice;
usdtLeft = usdt;
ltcLeft = ltc;
count = 0;
while (ltcLeft >= payload) {
    price *= (1 + rate);
    ltcLeft -= payload;
    usdtLeft += payload * price * (1 - exchangeRate);
    count++;
}
console.log("区间上限:", price, " 最少卖出次数:", count);
console.log("出上限市值:", (price * ltcLeft + usdtLeft) * rmbRate,"元");
console.log("price:",  price ,"=" ,price* rmbRate,"元\n");










lohiecan (鸡彼特 )- 2020-08-23 0 人
量化交易策略
package main
import "fmt"
func main () {  
    var name string 
    fmt.Println("Please input your name: ")
    // // 并不是读取一行到一个变量里,而是读取console的一行,把按空格划分的值存入设置的变量中
    fmt.Scanf("%s", &name)
    fmt.Println("Welcome "+name)
}
lohiecan (鸡彼特 )- 2020-08-22 0 人
golang 控制台的输入输出
没有了
1/125 下一页