相关疑难解决方法(0)

如何根据公共和私人指数计算RSA模数?

我有一个带模数m,公共指数e和私有指数的RSA私钥d,但我使用的程序需要模数的素因子pq.

有可能使用ed得到pq

encryption rsa

11
推荐指数
3
解决办法
2万
查看次数

在Python中,如何计算字符串或整数中的尾随零?

我正在尝试编写一个函数,它返回字符串或整数中的尾随0的数量.这是我正在尝试的,它没有返回正确的值.

def trailing_zeros(longint):
    manipulandum = str(longint)
    x = 0
    i = 1
    for ch in manipulandum:
        if manipulandum[-i] == '0':
            x += x
            i += 1
        else:
            return x
Run Code Online (Sandbox Code Playgroud)

python string

11
推荐指数
3
解决办法
8716
查看次数

如何计算字符串末尾的特定字符数忽略重复?

我有一系列的字符串:

my_text = "one? two three??"
Run Code Online (Sandbox Code Playgroud)

我只想数数?在字符串的末尾.以上应该返回2(而不是3).

到目前为止我尝试过的:

my_text.count("?") # returns 3
Run Code Online (Sandbox Code Playgroud)

python

4
推荐指数
1
解决办法
177
查看次数

标签 统计

python ×2

encryption ×1

rsa ×1

string ×1