首页 > 解决方案 > BigInteger 在 Swift 中的实现

问题描述

以下实现是在 C# 中完成的,我正在尝试转换为 Swift。

但是,我想知道如何BigInteger在 Swift 中使用,我以前没有见过这种数据类型。如果有人分享任何想法在 Swift 中创建类似的东西,我真的很感激。

custom.test_u128(BigInteger.One);
CollectionAssert.AreEqual(custom.get_bytes(), new byte[] { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });

protected readonly MemoryStream buffer;
public byte[] get_bytes() => buffer.ToArray();

标签: c#swiftbiginteger

解决方案


推荐阅读